This is the mail archive of the gas2@sourceware.cygnus.com mailing list for the gas2 project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
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