[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/14196] gold mistreats -Wl,-Ttext
From: |
ian at airs dot com |
Subject: |
[Bug gold/14196] gold mistreats -Wl,-Ttext |
Date: |
Mon, 04 Jun 2012 15:21:16 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=14196
Ian Lance Taylor <ian at airs dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #1 from Ian Lance Taylor <ian at airs dot com> 2012-06-04 15:21:16
UTC ---
As I explained in e-mail, for gold the -Ttext option sets the address of the
text segment, not the .text section. This is intentional. When I try your
test case, I get these section addresses, as reported by readelf -S:
[ 0] NULL 00000000 000000 000000 00 0 0
0
[ 1] .note.gnu.build-i NOTE 00008200 000200 000024 00 A 0 0
4
[ 2] .text PROGBITS 00008224 000224 000000 00 AX 0 0
4
[ 3] .data PROGBITS 00009000 001000 000000 00 WA 0 0
4
[ 4] .bss NOBITS 00009000 001000 000000 00 WA 0 0
4
[ 5] .note.gnu.gold-ve NOTE 00000000 001000 00001c 00 0 0
4
[ 6] .symtab SYMTAB 00000000 00101c 000050 10 7 1
4
[ 7] .strtab STRTAB 00000000 00106c 000020 00 0 0
1
[ 8] .shstrtab STRTAB 00000000 00108c 000056 00 0 0
1
The text segment starts at 0x8200. The .text section is not at 0x9200. If I
change the command to
gcc -o 1.img -ffreestanding -Wl,-Ttext,0x8200 ~/foo.s -nostdlib -m32 -v
--save-temps -Wl,--build-id=none
then the .text section is the first section in the text segment, and both are
at address 0x8200.
So as far as I can see everything works as intended, and works as you want.
You need to provide more information: the version of the linker that you are
using, and the command line passed to the linker, which you can get by using
gcc -v.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.