svn commit: r217260 - projects/binutils-2.17/contrib/binutils/ld/emultempl

Dimitry Andric dim at FreeBSD.org
Tue Jan 11 11:58:27 UTC 2011


On 2011-01-11 12:49, Kostik Belousov wrote:
>> -	&&  ((iself&&  sh_type == SHT_NOTE)
>> -	       || (!iself&&  CONST_STRNEQ (secname, ".note"))))
>> +	&&  CONST_STRNEQ (secname, ".note"))
> I am not sure, but it looks likely that (iself&&  sh_type == SHT_NOTE)
> part of condition better be kept.

Well, this specific test is what causes the .note section to end up
somewhere else than behind .interp.  I arrived at this by bisecting, but
the precise mechanism behind this failure is not clear to me yet.

For some reason, at that point, iself is always nonzero, but sh_type is
*not* SHT_NOTE, even for .note sections.  So then ld decides to put the
.note section somewhere far down the list of sections, increasing the
chance it will fall out of the first page of the executable.

This particular test was changed to fix binutils PR ld/1467, in commit:
http://sourceware.org/git/?p=binutils.git;a=commit;h=7f55fa5745fbe04b91e1fbd668d102f3166e03d8

However, the PR seems to be fixing a rather hypothetical situation,
which we seem to have never encountered, as the 'issue' had always been
in our binutils before.


More information about the svn-src-projects mailing list