Here's a program:
# cat main.cpp
#include <stdio.h>
int
main() {
printf("hello world\n");
return 0;
}
I have a script that builds that program:
# cat buildit.sh
LD=${LD:-'ld'}
g++ -c main.cpp
$LD -r -o relocatable.o --script script.lnk main.o
g++ -o main relocatable.o
./main
If I build the relocatable with the traditional linker, then the program prints
"hello world" as expected. If I build the relocatable with gold, then the
program prints garbage:
???H???
#
--
Summary: constant strings don't get relocated properly in a
relocatable built with gold
Product: binutils
Version: 2.20 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: gold
AssignedTo: ian at airs dot com
ReportedBy: andyc at bluearc dot com
CC: bug-binutils at gnu dot org,timb at bluearc dot com
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=6992
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
_______________________________________________
bug-binutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-binutils