From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 22 Mar 2010 20:19:00 +0300 From: Alexey Tourbin To: ALT Linux Team development discussions Message-ID: <20100322171900.GA8193@altlinux.org> Mail-Followup-To: ALT Linux Team development discussions References: <921f6bb41003210319v398e11ceq830f342a05e77c8b@mail.gmail.com> <20100321131440.GA1931@wo.int.altlinux.org> <20100321145113.GD30094@altlinux.org> <20100321153442.GA21854@wo.int.altlinux.org> <20100321191834.GE30094@altlinux.org> <20100322081149.GA12770@altlinux.org> <20100322135804.GD12770@altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: 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: Mon, 22 Mar 2010 17:19:03 -0000 Archived-At: List-Archive: List-Post: --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 22, 2010 at 05:41:07PM +0200, Kirill A. Shutemov wrote: > > Do they? =A0https://fedoraproject.org/wiki/GoldLinking - > > "may make it default linker in the future", with no schedule. > Do you think they rebuild packages with gold just for fun? ;) This does not look solid: https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking "Dangerous default behaviour", blah-blah-blah. I hope they have fun, though. :-) > > By the way, I'm not sure if gold(1) can do the --as-needed thing. > > Probably we need to implement it, too. >=20 > Yes, it can. It's default behavior. And it's not necessary to specify > libraries you want to link with at the end of command line. Can you please refer to a piece of source code where --as-needed logic is implemented? And is there an option like --no-as-needed then? You see, generally there can be two ld modes. 1) Dumb mode: just do what you see on the command line. You're just a special cat(1) for object files. Resolving symbols is none of your business. 2) Smart mode: try to do the right thing. Find implicit dependencies and remove unused libraries, based on how symbols are resolved. So the hallmark is whether a link editor should involve into resolving symbols (at all). The problem is that any implementation which supports symbol versioning _has_ to resolve symbols (to make versioned references). And since support for symbols is already there, it is hard to resist the temptation to implement "smart options"... I believe that "--as-need" + "--copy-dt-needed-entries" makes sense - it's a smart mode, and it does the right thing, most of the time. --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkunpoQACgkQfBKgtDjnu0ZvLgCg1QUWloJoPfoqiKOiiVv1Eiez zE4AnjbOvhM0TINtk3JWOlXqO5IWd3eI =DVxh -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j--