[Issue 7354] New: ld: GOT load reloc does not point to a movq instruction
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jan 23 15:21:34 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7354
Summary: ld: GOT load reloc does not point to a movq
instruction
Product: D
Version: D2
Platform: x86_64
OS/Version: Mac OS X
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: soul8o8 at gmail.com
--- Comment #0 from Heywood Floyd <soul8o8 at gmail.com> 2012-01-23 15:21:32 PST ---
I'm having trouble manually linking a 64-bit program on OSX with no exported
symbols in order to make `strip` work.
DMD 2.057, MacOS X 10.7.2, ld: llvm version 3.0svn, from Apple Clang 3.0 (build
211.10.1)
(I'm not entirely sure if this is a bug or enhancement. I feel not being able
to strip a binary from symbols is a bug.)
// - - - hello.d - - -
import std.stdio; void main(){ writeln("Hello"); }
// - - - 8< - -
The Bug
------
$ echo "#empty" > symbols.txt
$ dmd -c hello.d
$ ld -o hello hello.o -lphobos2 -lpthread -lm -lcrt1.o -macosx_version_min 10.6
-exported_symbols_list symbols.txt
ld: GOT load reloc does not point to a movq instruction in
_D3std6string16__T7indexOfTaTaZ7indexOfFAxaAxaE3std6string13CaseSensitiveZl138__T16simpleMindedFindS104_D3std6string16__T7indexOfTaTaZ7indexOfFAxaAxaE3std6string13CaseSensitiveZl15__dgliteral1242MFNaNbNfwwZbTAxaTAxaZ16simpleMindedFindMFAxaAxaZAxa
from /usr/local/lib/libphobos2.a(string_5a_1601.o) for inferred architecture
x86_64
$ _
It works with -m32
------
$ echo "#empty" > symbols.txt
$ dmd -m32 -c hello.d
$ ld -o hello hello.o -lphobos2 -lpthread -lm -lcrt1.o -macosx_version_min 10.6
-exported_symbols_list symbols.txt
$ ./hello
Hello
$ _
It also works without the -exported_symbols_list (but then `strip` has no
effect)
------
$ dmd -c hello.d
$ ld -o hello hello.o -lphobos2 -lpthread -lm -lcrt1.o -macosx_version_min 10.6
$ ./hello
Hello
$ strip hello
$ nm hello
0000000000022948 T _D3std8datetime7SysTime4toTMMxFNbZS4core4stdc4time2tm
0000000000021eb0 T _D3std8datetime7SysTime4yearMFNdiZv
0000000000021e90 T _D3std8datetime7SysTime4yearMxFNbNdZs
0000000000022020 T _D3std8datetime7SysTime5monthMFNdE3std8datetime5MonthZv
0000000000022000 T _D3std8datetime7SysTime5monthMxFNbNdZE3std8datetime5Month
0000000000021e60 T
_D3std8datetime7SysTime5opCmpMxFNaNbxS3std8datetime7SysTimeZi
0000000000022800 T _D3std8datetime7SysTime5toUTCMxFNaNbZS3std8datetime7SysTime
// ....hundreds more etc.
$ _
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list