This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Help needed - defining the output section order
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com, Simon Kissel <scamp at untergrund dot net>
- Date: Wed, 24 Aug 2005 09:30:08 +0200
- Subject: Re: Help needed - defining the output section order
- References: <534597898.20050822130316@untergrund.net> <4309C0CC.4050200@redhat.com>
Sadly this only results in
"Not enough room for program headers (allocated 5, need 6)" and "final
link failed: Bad value".
Ah well, that is because your new linker script is too simple. There
is a section in the linker documentation that talks about this
problem:
[snip]
So what you probably need to do is to add a PHDRS command to your
linker script.
It might be enough if you prevent ld from creating the magic stack
segment behind its own back, e.g., I have this in my Makefiles:
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ && $(OBJCOPY) -R .note.GNU-stack $@
(using /DISCARD/ in your linker script is _not_ enough).
Segher