https://sourceware.org/bugzilla/show_bug.cgi?id=16821

--- Comment #3 from Corinna Vinschen <corinna at vinschen dot de> ---
Hi Nick,

thanks for the patch.

(In reply to Nick Clifton from comment #2)
>   I have uploaded a patch which is a partial fix for the problem.  It
> detects out-of-range absolute values and tries to convert them into section
> relative values.  This works for most cases, but it fails for the
> __image_base__ and __ImageBase__ symbols, and possibly some others that I
> have not yet encountered.  The problem is that these symbols have a value
> which is less than the lowest addressed section, but higher than 1^32. 
> (Note the value of ImageBase in the PE header is not affected by this
> problem.  It is only the *symbols* __image_base__ and __ImageBase__ that are
> affected).

Well, I'm wondering if ld couldn't utilize the fact that executables
are never bigger than 2 Gigs.  I'm not entirely sure, but afaik the
relocation information is signed.  Couldn't __image_base__ be defined
with a negative offset relative to the first section?

>   One thing that patch does not do at the moment is issue an error message
> when it knows that the truncation is taking place and it has not found a way
> around it.  I omitted the warning because I know that it will be triggered
> for every x86_64 cygwin binary that gets built, and most, if not all of
> them, do not care about the value of __image_base__.

That sonds right to me, at least as long as there's no solution for the
__image_base__ problem.


Thanks,
Corinna

-- 
You are receiving this mail because:
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to