From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sun, 13 Aug 2006 20:00:10 +0400 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20060813160010.GP24054@localhost.localdomain> Mail-Followup-To: ALT Devel discussion list References: <20060811184453.GD15128@procyon.home> <20060812135000.GD15159@procyon.home> <20060812140505.GG24054@localhost.localdomain> <20060812143634.GH24054@localhost.localdomain> <20060812154901.GF15159@procyon.home> <20060813075158.GJ24054@localhost.localdomain> <20060813121309.GA15478@procyon.home> <20060813122044.GO24054@localhost.localdomain> <20060813145500.GB15478@procyon.home> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LqInKle6vr1NBc7W" Content-Disposition: inline In-Reply-To: <20060813145500.GB15478@procyon.home> Subject: Re: [devel] libopenobex-1.3 symbol versioning patch X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.7 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 16:00:09 -0000 Archived-At: List-Archive: List-Post: --LqInKle6vr1NBc7W Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 13, 2006 at 06:55:00PM +0400, Sergey Vlasov wrote: > On Sun, Aug 13, 2006 at 04:20:44PM +0400, Alexey Tourbin wrote: > > =F1 =C9 =C7=CF=D7=CF=D2=C0: =C5=D3=CC=C9 =D5=C4=C1=CC=C9=D4=D8 =D3=D4= =C1=D2=D9=CA =C9=CE=D4=C5=D2=C6=C5=CA=D3 =D0=CF=CC=CE=CF=D3=D4=D8=C0, =D4= =CF =C2=D5=C4=C5=D4 =C1=CE=CD=C5=D4. >=20 > =F4=CF=C7=C4=C1 =DE=C5=CD =DC=D4=CF =CC=D5=DE=DB=C5 =D3=CD=C5=CE=D9 sonam= e? =EE=C9=DE=C5=CD; =D2=C1=DA=D7=C5 =DE=D4=CF soname =CF=D3=D4=C1=CE=C5=D4=D3= =D1 =CB=C1=CB =D7 =C1=D0=D3=D4=D2=C9=CD=C5, =C9 =CB=CF=C4, =D3=CB=CF=CD=C9= =CC=C9=D2=CF=D7=C1=CE=CE=D9=CA elsewhere, =C2=D5=C4=C5=D4 =D2=C1=C2=CF=D4=C1=D4=D8. =FC=D4=CF =D0=CF=C8= =CF=D6=C5 =D7=CF=D4 =CE=C1 =DE=D4=CF: =D3=CD=C5=CE=C9=D4=D8 soname, =CE=CF =D0=CF=D3=D4=C1=D7=C9=D4=D8 =D3=C9=CD=CC=C9=CE=CB =CE=C1 =D3=D4=C1=D2=D9=CA= soname =C9 =DA=C1=D0=C9=D3=C1=D4=D8 =C5=C7=CF =D7 Provides. > =F7=CF=CF=C2=DD=C5 =D5 =CD=C5=CE=D1 =D3=C5=CA=DE=C1=D3 =D0=CF=CC=D5=DE=C9= =CC=CF=D3=D8 =D7=CF=D4 =DE=D4=CF: >=20 > #define symver_concat(pre, post) pre##post > #define symver_tmp_name(name, line) symver_concat(name##_version_, line) >=20 > #define symver_set_weak(real) \ > __asm__ (".weak " #real); \ > __asm__ (".weak ." #real) >=20 > #define symver_define_alias(alias, name) \ > extern __typeof__ (name) alias __attribute__((__alias__(#name))) >=20 > #define symver_set_version(real, name, version) \ > __asm__ (".symver " #real "," #name "@" version); \ > __asm__ (".symver ." #real ",." #name "@" version) >=20 > #define symver_declare_version(alias, name, version) \ > symver_define_alias(alias, name); \ > symver_set_version(alias, name, version) >=20 > #define symbol_version(name, version) \ > symver_declare_version(symver_tmp_name(name, __LINE__), \ > name, #version) >=20 > #define symbol_default_version(name, version) \ > symver_set_weak(name); \ > symver_declare_version(symver_tmp_name(name, __LINE__), \ > name, "@" #version) >=20 > =E9=D3=D0=CF=CC=D8=DA=D5=C5=D4=D3=D1 =CB=C1=CB-=D4=CF =D4=C1=CB: >=20 > symbol_default_version(junk, JUNK_1.1); > symbol_version(junk, JUNK_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1=C0=D4 =C9 =CE=C1 = i586. $ tail -3 func.c void func() { } symbol_default_version(func, FUNC_1.2); symbol_version(func, FUNC_1.1); $ gcc -E func.c |tail -3 void func() { } __asm__ (".weak " "func"); __asm__ (".weak ." "func"); extern __typeof__ (f= unc) func_version_28 __attribute__((__alias__("func"))); __asm__ (".symver = " "func_version_28" "," "func" "@" "@" "FUNC_1.2"); __asm__ (".symver ." "f= unc_version_28" ",." "func" "@" "@" "FUNC_1.2"); extern __typeof__ (func) func_version_29 __attribute__((__alias__("func")))= ; __asm__ (".symver " "func_version_29" "," "func" "@" "FUNC_1.1"); __asm__= (".symver ." "func_version_29" ",." "func" "@" "FUNC_1.1"); $ [ =E8=CD... =C1 =D1 =D0=CF=DE=C5=CD=D5-=D4=CF =C4=D5=CD=C1=CC, =DE=D4=CF = =CB=CF=CE=CB=C1=D4=C5=CE=C1=C3=C9=C5=CA =D3=D4=D2=CF=CB =DA=C1=CE=C9=CD=C1= =C5=D4=D3=D1 =D0=D2=C5=D0=D2=CF=C3=C5=D3=D3=CF=D2... ] $ objdump -tw func.o |grep func func.o: file format elf32-i386 00000000 l df *ABS* 00000000 func.c 00000000 w F .text 00000005 func 00000000 g F .text 00000005 func_version_28 00000000 g F .text 00000005 func_version_29 00000000 g F .text 00000005 func@@FUNC_1.2 00000000 g F .text 00000005 func@FUNC_1.1 $ =FA=C4=CF=D2=CF=D7=CF! =FC=D4=C9 =CD=C1=CB=D2=CF=D3=D9 =D3=D4=CF=C9=D4 =CB= =D5=C4=C1-=CE=C9=C2=D5=C4=D8 =CF=D4=C4=C5=CC=D8=CE=CF =DA=C1=D0=C1=CB=CF=D7= =C1=D4=D8; =D4=CF=CC=D8=CB=CF =D4=D2=D5=C4=CE=CF =D3=CB=C1=DA=C1=D4=D8, =CB=D5=C4=C1 =C9=CD=C5=CE=CE=CF. --LqInKle6vr1NBc7W Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFE30yKfBKgtDjnu0YRAilKAKCkHpek4yhcoK2TSwwV5uYJ8XiwkgCcCqQp huKJs9gq93dX5SpyBHWMz14= =zDaR -----END PGP SIGNATURE----- --LqInKle6vr1NBc7W--