This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold vs libc
- From: Ian Lance Taylor <iant at google dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Cary Coutant <ccoutant at google dot com>, Alan Modra <amodra at gmail dot com>, "GNU C. Library" <libc-alpha at sourceware dot org>, Binutils <binutils at sourceware dot org>, Rafael Ãvila de EspÃndola <rafael dot espindola at gmail dot com>
- Date: Wed, 10 Sep 2014 17:04:41 -0700
- Subject: Re: gold vs libc
- Authentication-results: sourceware.org; auth=none
- References: <20140330042516 dot 1A88E74481 at topped-with-meat dot com> <20140330045552 dot GX18201 at bubble dot grove dot modra dot org> <20140330050615 dot 7DC5774481 at topped-with-meat dot com> <CAKOQZ8wPgdHfA9QJWQ9yVO9gVQKL=HF-rpuipCBxzsx3=TcqwA at mail dot gmail dot com> <20140331200446 dot A09B074430 at topped-with-meat dot com> <CAKOQZ8x19YZ_oyJXyxe9JST4nfaG8dDvVrdf-vmgkNWydrpsrw at mail dot gmail dot com> <20140331214025 dot E61517447E at topped-with-meat dot com> <CAKOQZ8x1W0YxJSq+X74EjMj7_02uTZq82qzhmF=oQ-cTd4S1mQ at mail dot gmail dot com> <CAHACq4oRKDGKAUu3octDCxKg2EueCyf8kHWj0t8g9+LmE3JagQ at mail dot gmail dot com> <20140910225238 dot 0B6362C39CF at topped-with-meat dot com>
On Wed, Sep 10, 2014 at 3:52 PM, Roland McGrath <roland@hack.frob.com> wrote:
>
> Incidentally, Ian mentioned Gold having had a special case for the
> __EH_FRAME_BEGIN__ symbol. But 'git log -G__EH_FRAME_BEGIN -- gold' finds
> no point in the history where Gold's source code mentioned that symbol. Do
> you know what Ian was referring to? From
> https://sourceware.org/ml/libc-alpha/2014-04/msg00021.html:
>
> I freely grant that GCC's crtbegin.o file tries this trick in a number
> of different ways--even worse, crtend.o has trailing symbols. Because
> of this existing behaviour, gold has various special cases to make it
> continue to work. One of those special cases is for
> __EH_FRAME_BEGIN__. As you've seen, the existing special case does
> not work any more. This is an unfortunate interaction. I don't think
> it's an obvious bug.
I shouldn't have said __EH_FRAME_BEGIN__. There is no special case
for the symbol. There is a special case for the sections found in
typical crtbegin/crtend files. It's these lines in
Eh_frame::add_ehframe_input_section in gold/ehframe.cc:
if (contents_len == 0)
return false;
// If this is the marker section for the end of the data, then
// return false to force it to be handled as an ordinary input
// section. If we don't do this, we won't correctly handle the case
// of unrecognized .eh_frame sections.
if (contents_len == 4
&& elfcpp::Swap<32, big_endian>::readval(pcontents) == 0)
return false;
Ian