From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sun, 21 Mar 2010 18:34:43 +0300 From: "Dmitry V. Levin" To: ALT Linux Team development discussions Message-ID: <20100321153442.GA21854@wo.int.altlinux.org> Mail-Followup-To: ALT Linux Team development discussions References: <921f6bb41003210302o7bffd763q1ffbc620f7ce1fec@mail.gmail.com> <20100321101137.GE12359@wrars-comp.wrarsdomain> <921f6bb41003210319v398e11ceq830f342a05e77c8b@mail.gmail.com> <20100321131440.GA1931@wo.int.altlinux.org> <20100321145113.GD30094@altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline In-Reply-To: <20100321145113.GD30094@altlinux.org> X-fingerprint: FE4C 93AB E19A 2E4C CB5D 3E4E 7CAB E6AC 9E35 361E Subject: Re: [devel] Q: --no-copy-dt-needed-entries X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 15:34:44 -0000 Archived-At: List-Archive: List-Post: --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 21, 2010 at 05:51:13PM +0300, Alexey Tourbin wrote: > On Sun, Mar 21, 2010 at 04:14:41PM +0300, Dmitry V. Levin wrote: > > On Sun, Mar 21, 2010 at 01:19:10PM +0300, Evgeny Sinelnikov wrote: > > > 21 =CD=C1=D2=D4=C1 2010 =C7. 13:11 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC= =D8 Andrey Rahmatullin =CE=C1=D0=C9=D3=C1=CC: > > > > On Sun, Mar 21, 2010 at 01:04:53PM +0300, Stanislav Ievlev wrote: > > > >> >> =F7=CD=C5=D3=D4=CF =D4=CF=C7=CF =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C1=D1 =C2=C9=C2=CC=C9=CF= =D4=C5=CB=C1, =CB=CF=D4=CF=D2=D5=C0 =D4=D9 =D4=CF=D6=C5 =C9=D3=D0=CF=CC=D8= =DA=D5=C5=DB=D8. > > >=20 > > > > =E1 =D0=D2=C9 =DE=A3=CD =D4=D5=D4? =F2=C5=DE=D8 =CF =D4=CF=CD, =DE= =D4=CF =C5=D3=CC=C9 =D4=D9 =C9=D3=D0=CF=CC=D8=DA=D5=C5=DB=D8 =C2=C9=C2=CC= =C9=CF=D4=C5=CB=D5, =D4=C5=C2=C5 > > > > =CF=C2=D1=DA=C1=D4=C5=CC=D8=CE=CF =CE=C1=C4=CF =CC=C9=CE=CB=CF=D7= =C1=D4=D8=D3=D1 =D3 =CE=C5=CA =D1=D7=CE=CF. > > >=20 > > > =EE=D5, =C4=C1... > >=20 > > --no-copy-dt-needed-entries =CD=CF=D6=CE=CF =D2=C1=D3=D3=CD=C1=D4=D2=C9= =D7=C1=D4=D8 =CB=C1=CB =C4=CF=D0=CF=CC=CE=C5=CE=C9=C5 =CB --as-needed: > >=20 > > =F0=C5=D2=D7=D9=CA =D0=C1=D2=C1=CD=C5=D4=D2 =DA=C1=D3=D4=C1=D7=CC=D1=C5= =D4 =CC=C9=CE=CB=CF=D7=C1=D4=D8 =D3=D7=CF=C0 =D0=D2=CF=C7=D2=C1=CD=CD=D5 = =D3=CF =D7=D3=C5=CD=C9 > > =C2=C9=C2=CC=C9=CF=D4=C5=CB=C1=CD=C9, =CB=CF=D4=D2=D9=C5 =DC=D4=C1 =D0= =D2=CF=C7=D2=C1=CD=CD=C1 =CE=C5=D0=CF=D3=D2=C5=C4=D3=D4=D7=C5=CE=CE=CF =C9= =D3=D0=CF=CC=D8=DA=D5=C5=D4. >=20 > In ld(1) manpage, perhaps the description is not quite clear. And we > should strive for very accurate wording in order to avoid a total mess. > (E.g. we'd better avoid anthropomorphic clauses like "zastavlyaet".) With --no-copy-dt-needed-entries in effect, each ELF output executable will have to be linked with every library it uses directly. > | --copy-dt-needed-entries > | --no-copy-dt-needed-entries > | This option affects the treatment of dynamic libraries > | referred to by DT_NEEDED tags inside ELF dynamic libraries > | mentioned on the command line. Normally the linker will add > | a DT_NEEDED tag to the output binary for each library > | mentioned in a DT_NEEDED tag in an input dynamic library. >=20 > So, "normally" what's happening is something like a "shallow closure". > E.g. when I link with libgtk+2, glib2 is going to be linked in, too, > automatically. >=20 > | With --no-copy-dt-needed-entries specified on the command > | line however any dynamic libraries that follow it will have > | their DT_NEEDED entries ignored. The default behaviour can > | be restored with --copy-dt-needed-entries. >=20 > So --copy-dt-needed-entries is the default - which is to link in more > dependencies automatically; --no-copy-dt-needed-entries reverts this > logic to its bare minimum - only what you specified on the command line > gets actually linked in (so you must specify e.g. both libgtk+2 and glib2= ). If your application doesn't use glib2, there is no need to link with glib2. > | This option also has an effect on the resolution of symbols in > | dynamic libraries. With the default setting dynamic libraries > | mentioned on the command line will be recursively searched, > | following their DT_NEEDED tags to other libraries, in > | order to resolve symbols required by the output binary. With > | --no-copy-dt-needed-entries specified however the searching of > | dynamic libraries that follow it will stop with the dynamic > | library itself. No DT_NEEDED links will be traversed to > | resolve symbols. >=20 > Again, "this option also has an effect on the resolution of symbols" > is a poor wording. Does this option affect only DT_NEEDED entries, > or does it also set some other flags in the output binary? Does this > paragraph address the ld(1) behaviour or rather ld.so(8) behaviour? The abovementioned options affects the ld(1) behaviour only. > > =F7=D4=CF=D2=CF=CA =D0=C1=D2=C1=CD=C5=D4=D2 =CE=C5 =C4=C1=C5=D4 =D3=CC= =C9=CE=CB=CF=D7=C1=D4=D8 =D3=D7=CF=C0 =D0=D2=CF=C7=D2=C1=CD=CD=D5 =D3 =C2= =C9=C2=CC=C9=CF=D4=C5=CB=C1=CD=C9, =CB=CF=D4=CF=D2=D9=C5 > > =DC=D4=C1 =D0=D2=CF=C7=D2=C1=CD=CD=C1 =CE=C5 =C9=D3=D0=CF=CC=D8=DA=D5= =C5=D4 =CE=C5=D0=CF=D3=D2=C5=C4=D3=D4=D7=C5=CE=CE=CF. > >=20 > > =F7 =D2=C5=DA=D5=CC=D8=D4=C1=D4=C5 =D0=D2=CF=C7=D2=C1=CD=CD=C1 =C4=CF= =CC=D6=CE=C1 =D0=CF=CC=D5=DE=C9=D4=D8=D3=D1 =D3=CC=C9=CE=CB=CF=D7=C1=CE=CE= =CF=CA =D3 =D4=C5=CD=C9 =C9 =D4=CF=CC=D8=CB=CF =D3 > > =D4=C5=CD=C9 =C2=C9=C2=CC=C9=CF=D4=C5=CB=C1=CD=C9, =CB=CF=D4=CF=D2=D9= =C5 =CF=CE=C1 =CE=C5=D0=CF=D3=D2=C5=C4=D3=D4=D7=C5=CE=CE=CF =C9=D3=D0=CF=CC= =D8=DA=D5=C5=D4, =D4.=C5. =C4=CF=CC=D6=CE=C1 > > =D0=D2=CF=C9=DA=CF=CA=D4=C9 =D0=D2=C1=D7=C9=CC=D8=CE=C1=D1 =CF=D0=D4=C9= =CD=C1=CC=D8=CE=C1=D1 =CC=C9=CE=CB=CF=D7=CB=C1. >=20 > So, contrary to the initial message, with --as-needed on, there seems > to be NO REASON to enable --no-copy-dt-needed-entries by default. Just the opposite, there is a reason to link ELF executables with all libraries they use directly. Applications should be neither overlinked nor underlinked. The first problem is solved by --as-needed, the second issue will be fixed by enabling --no-copy-dt-needed-entries by default. --=20 ldv --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkumPJIACgkQfKvmrJ41Nh6VBwCgkfPw5YC5AnG7RO6yD0CMA+d/ sjcAnj1ShD0ebIquD2trNcsRjN4PLgjR =Jjwj -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4--