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]

Adding custom sections to default linker script


Hi,

(the following is all on Linux platforms for various architectures)

Our compiler generates a few special sections:
* some which should always be kept/never be garbage collected
* some which should be inserted at a particular place

The way I'm currently trying to do this, is by adding the following to
the linker response file:

SECTIONS
{
  .data           :
  {
    KEEP (*(.fpc .fpc.n_version .fpc.n_links))
  }
  .threadvar _edata : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }
}

This generates the warning "./link.res contains output sections; did you
forget -T?". I did not "forget" -T, because I don't want to replace the
entire linker script, I just want to augment it.

So my question: is there a different, more appropriate way to do this?
The reason I don't want to completely replace/duplicate the default
linker script is primarily because it often contains Linux
distribution-specific library search paths, which moreover tend to
change every full moon.

Thanks,


Jonas


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