[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/14196] gold mistreats -Wl,-Ttext
From: |
cjwatson at debian dot org |
Subject: |
[Bug gold/14196] gold mistreats -Wl,-Ttext |
Date: |
Wed, 02 Jan 2013 02:42:17 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=14196
Colin Watson <cjwatson at debian dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cjwatson at debian dot org
--- Comment #3 from Colin Watson <cjwatson at debian dot org> 2013-01-02
02:42:17 UTC ---
Adding -Wl,-N more accurately reproduces the bug as seen by GRUB.
GNU gold (GNU Binutils for Ubuntu 2.23.1) 1.11
$ gcc -v -fuse-ld=gold -o 1.img -ffreestanding -Wl,-Ttext,0x8200 1.S -nostdlib
-m32 -Wl,-N -Wl,--build-id=none
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.7.2-16ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --enable-targets=all --enable-multiarch
--disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32
--with-tune=generic --enable-checking=release --build=i686-linux-gnu
--host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-16ubuntu1)
COLLECT_GCC_OPTIONS='-v' '-fuse-ld=gold' '-o' '1.img' '-ffreestanding'
'-nostdlib' '-m32' '-mtune=generic' '-march=i686'
/usr/lib/gcc/i686-linux-gnu/4.7/cc1 -E -lang-asm -quiet -v -imultilib .
-imultiarch i386-linux-gnu 1.S -m32 -mtune=generic -march=i686 -fuse-ld=gold
-ffreestanding -fno-directives-only -o /tmp/cc6TeMd1.s
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/i686-linux-gnu/4.7/../../../../i686-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/i686-linux-gnu/4.7/include
/usr/local/include
/usr/lib/gcc/i686-linux-gnu/4.7/include-fixed
/usr/include/i386-linux-gnu
/usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-fuse-ld=gold' '-o' '1.img' '-ffreestanding'
'-nostdlib' '-m32' '-mtune=generic' '-march=i686'
as -v --32 -o /tmp/ccHEpBci.o /tmp/cc6TeMd1.s
GNU assembler version 2.23.1 (i686-linux-gnu) using BFD version (GNU Binutils
for Ubuntu) 2.23.1
COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.7/:/usr/lib/gcc/i686-linux-gnu/4.7/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.7/:/usr/lib/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.7/:/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.7/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i686-linux-gnu/4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-fuse-ld=gold' '-o' '1.img' '-ffreestanding'
'-nostdlib' '-m32' '-mtune=generic' '-march=i686'
/usr/lib/gcc/i686-linux-gnu/4.7/collect2 --sysroot=/ --build-id --eh-frame-hdr
-m elf_i386 --hash-style=gnu --as-needed -dynamic-linker /lib/ld-linux.so.2 -z
relro -fuse-ld=gold -o 1.img -L/usr/lib/gcc/i686-linux-gnu/4.7
-L/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu
-L/usr/lib/gcc/i686-linux-gnu/4.7/../../../../lib -L/lib/i386-linux-gnu
-L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib
-L/usr/lib/gcc/i686-linux-gnu/4.7/../../.. -Ttext 0x8200 /tmp/ccHEpBci.o -N
--build-id=none
$ readelf -S 1.img There are 8 section
headers, starting at offset 0x10d0:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf
Al
[ 0] NULL 00000000 000000 000000 00 0 0
0
[ 1] .text PROGBITS 00009000 001000 000000 00 AX 0 0
4
[ 2] .data PROGBITS 00009000 001000 000000 00 WA 0 0
4
[ 3] .bss NOBITS 00009000 001000 000000 00 WA 0 0
4
[ 4] .note.gnu.gold-ve NOTE 00000000 001000 00001c 00 0 0
4
[ 5] .symtab SYMTAB 00000000 00101c 000050 10 6 1
4
[ 6] .strtab STRTAB 00000000 00106c 000020 00 0 0
1
[ 7] .shstrtab STRTAB 00000000 00108c 000043 00 0 0
1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
GNU ld appears to optimise away the .text section, but if I add a "nop" to
avoid that, it correctly starts .text at 00008200 with these options.
--
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug gold/14196] gold mistreats -Wl,-Ttext,
cjwatson at debian dot org <=