bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/16821] x86_64 PE/COFF: ld truncates addresses of symbols from li


From: corinna at vinschen dot de
Subject: [Bug ld/16821] x86_64 PE/COFF: ld truncates addresses of symbols from linker scripts to 32 bit
Date: Wed, 09 Apr 2014 19:06:36 +0000

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]