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]

Re: Help needed - defining the output section order


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



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