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

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Nick Clifton <nickc at redhat dot com> ---
Hi Corinna,

  DJ has found the cause of the problem: the PE and PE32+ file formats store
the value of symbols in a 32-bit field.  For section relative symbols this
amount is usually enough, as section addresses can be 64-bit.  But for absolute
symbols any value needing more than 32-bits is silently truncated by the
linker.

  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).

  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__.

  Any suggestions as to how to handle __image_base__ will be greatfully
received.

Cheers
  Nick

-- 
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