Creating .note sections

Ian Lance Taylor ian@airs.com
Thu Apr 24 21:41:00 GMT 2003


Ceri Storey <cez@necrofish.org.uk> writes:

> On Thu, Apr 24, 2003 at 10:19:35AM -0700, Ian Lance Taylor wrote:
> > That's interesting.  I assume that the section has a fixed size.  That
> Pretty much.
> 
> > [...] 
> 
> Thanks all, but I've decided that libelf is a better solution, if rather
> more low level. I'm just concentrating on getting it working, for the
> moment :)

The problem with adding the section after the executable has been
linked is that you want the section to go into a loadable segment, but
the linker didn't make space for it.  You're going to have to refiddle
the loadable segments, which means that you're going to have to move
sections around in virtual memory space and also in the file itsefl.
It may be that libelf will take care of all that for you; I haven't
used it.

This issue is why I recommended creating an empty loadable section of
the right size, so the linker puts it in a loadable segment for you
and you don't have to fuss with adjusting the segments.

Ian



More information about the Binutils mailing list