From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 MIME-Version: 1.0 In-Reply-To: <20100322171900.GA8193@altlinux.org> References: <921f6bb41003210319v398e11ceq830f342a05e77c8b@mail.gmail.com> <20100321145113.GD30094@altlinux.org> <20100321153442.GA21854@wo.int.altlinux.org> <20100321191834.GE30094@altlinux.org> <20100322081149.GA12770@altlinux.org> <20100322135804.GD12770@altlinux.org> <20100322171900.GA8193@altlinux.org> Date: Mon, 22 Mar 2010 20:31:59 +0200 Message-ID: From: "Kirill A. Shutemov" To: ALT Linux Team development discussions Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 18:32:05 -0000 Archived-At: List-Archive: List-Post: 2010/3/22 Alexey Tourbin : > On Mon, Mar 22, 2010 at 05:41:07PM +0200, Kirill A. Shutemov wrote: >> > Do they? =C2=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. Currently, valid changing of linking in a library may break building of a package which links to it (directly or indirectly). And cause of breakage will not be obvious.. > 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. >> >> 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? See Layout::finish_dynamic_section() at layout.cc. I guess it's what you wa= nt. >=C2=A0And is there an option like --no-as-needed then? Yes. See General_options::as_needed. > > 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. =C2=A0Find implicit dependencie= s > 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). =C2=A0The problem is that any implementation which supp= orts > 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. Reading the bug that you have specified, I have the impression that --copy-dt-needed-entries is a hack in GNU ld to workaround buggy software. Do you know a linker, except GNU ld, which provides simmilar fuctionallity? > > _______________________________________________ > Devel mailing list > Devel@lists.altlinux.org > https://lists.altlinux.org/mailman/listinfo/devel >