This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

LD 2.20 absolute / relative symbol assignment issue


I'm using 2.20 binutils as part of a cygwin->powerpc gcc cross-compiler.
A fairly typical linker input section in my link file looks like:

  .example (NOLOAD) :
  {
    __EXAMPLE_START = ABSOLUTE(.);
    *(.example)
    . = LENGTH(EXAMPLE_MEM);
    __EXAMPLE_END = ABSOLUTE(.) - 1 ;
  } > EXAMPLE_MEM

I have two issues:

1) In most cases the values assigned to symbols such as __EXAMPLE_START
are absolute ones whether I use ABSOLUTE() or not; I cannot get
section-relative symbol values.

2) In some cases the use of the ABSOLUTE() keyword actually results in
the section-relative value being assigned!

I cannot work out what is causing behaviour 1 or 2 to be the case for a
given assignment, which means the only apparently reliable coding for my
linker script is to use . without ABSOLUTE() and yet assume that
absolute addresses are returned, in apparent contradiction to the ld
documentation.

I have a feeling I'm being stupid somewhere and that others must have
come across this, but I just can't seem to find out what is going on.
The behaviour appears similar on older versions of binutils. Can anyone
shed light?

Thanks if you can,

Mark


*****************************************************************
This email has been checked by the altohiway Mailcontroller Service
*****************************************************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]