From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: hjl@nynexst.com Cc: raeburn@cygnus.com, gas2@cygnus.com Subject: Re: gas-940814 ld bugs Date: Mon, 15 Aug 1994 08:35:00 -0000 Message-id: <199408151535.LAA09278@sanguine.cygnus.com> References: <9408150533.AA18413@titanic.nynexst.com> X-SW-Source: 1994/msg00066.html From: hjl@nynexst.com (H.J. Lu) Date: Mon, 15 Aug 94 1:33:47 EDT gas-940814 configured for i486-linux. If I do ld -x -Ttext 5ffff000 -Tdata 6008e000 foo.o the size of the output file is ridiculous. I got -rwxr-xr-x 1 hjl isl 8367 Aug 15 01:54 a.out text data bss dec hex filename 4064 4096 0 8160 1fe0 a.out But I am looking for about 0x8e000 bytes. When you use -Ttext and -Tdata, the linker will link the code as if the .text and .data sections start at the given address. It will also tell BFD to store the given VMA with the section. It will not insert extra zero bytes. The problem, of course, is that a.out has no way to store the starting VMA of a section. This is one of several disadvantages of the a.out format. The solution is to either use a different object file format, or to modify the linker script along the lines of .text 0x1020 { . = 0x5ffff000 *(.text) } Ian