This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Defining a section that isn't file-backed
Thanks Nick,
I've tried this but unfortunately get:
gcc -o lds1 -Wl,-T,lds1.ldscript -lm -ldl -lncurses -lpthread -lssl -lpam -luuid -ltermcap lds1.c
/usr/bin/ld: lds1: Not enough room for program headers (allocated 7, need 8)
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
I'm using the default linker script on Fedora, but with the following
inserted after the code which lays out the BSS:
/* WINE: reserve PE load area */
.empty 0x400000 : { KEEP (*(.empty)) }
As you probably already know, I'm a Wine developer and want this to fix
problems caused by exec-shield and prelink. So, an area at 0x400000 of
256mb is a good starting point.
Any tips on what I'm doing wrong? I'm not sure if I need a new program
header for a new ELF section, and if so I don't know how to allocate
more room for one.
thanks -mike
On Mon, 2004-02-23 at 09:49, Nick Clifton wrote:
> What you need is a combination of a linker script and an assembler
> source file. For example if you create an assembler file containing
> this:
> .section .empty, "a", @nobits
> .zero 40000
>
> and then a linker script which contains:
>
> .empty 0x100 : { KEEP (*(.empty)) }
>
> You should get what you want. Obviously you will need to change the
> numbers to reflect the size and location that you want.
>
> Cheers
> Nick
>