mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Fix Bugzilla 24401 - OSX: Linker error: GOT load reloc does not point to a movq instruction
This commit is contained in:
parent
6f2a6f919d
commit
baf8ee195a
2 changed files with 10 additions and 6 deletions
|
@ -942,6 +942,8 @@ void MachObj_term(const(char)* objfilename)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put out relocation data
|
// Put out relocation data
|
||||||
|
// See mach-o/reloc.h for some examples of what should be generated and when:
|
||||||
|
// https://github.com/apple-oss-distributions/xnu/blob/rel/xnu-10002/EXTERNAL_HEADERS/mach-o/x86_64/reloc.h
|
||||||
mach_numbersyms();
|
mach_numbersyms();
|
||||||
for (int seg = 1; seg < SegData.length; seg++)
|
for (int seg = 1; seg < SegData.length; seg++)
|
||||||
{
|
{
|
||||||
|
@ -1053,12 +1055,8 @@ void MachObj_term(const(char)* objfilename)
|
||||||
rel.r_type = X86_64_RELOC_SIGNED;
|
rel.r_type = X86_64_RELOC_SIGNED;
|
||||||
else if ((s.Sfl == FLfunc || s.Sfl == FLextern || s.Sclass == SC.global ||
|
else if ((s.Sfl == FLfunc || s.Sfl == FLextern || s.Sclass == SC.global ||
|
||||||
s.Sclass == SC.comdat || s.Sclass == SC.comdef) && r.rtype == RELaddr)
|
s.Sclass == SC.comdat || s.Sclass == SC.comdef) && r.rtype == RELaddr)
|
||||||
{
|
|
||||||
rel.r_type = X86_64_RELOC_GOT_LOAD;
|
|
||||||
if (seg == eh_frame_seg ||
|
|
||||||
seg == except_table_seg)
|
|
||||||
rel.r_type = X86_64_RELOC_GOT;
|
rel.r_type = X86_64_RELOC_GOT;
|
||||||
}
|
|
||||||
rel.r_address = cast(int)r.offset;
|
rel.r_address = cast(int)r.offset;
|
||||||
rel.r_symbolnum = s.Sxtrnnum;
|
rel.r_symbolnum = s.Sxtrnnum;
|
||||||
rel.r_pcrel = 1;
|
rel.r_pcrel = 1;
|
||||||
|
|
6
compiler/test/runnable/issue24401.d
Normal file
6
compiler/test/runnable/issue24401.d
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
// PERMUTE_ARGS:
|
||||||
|
// https://issues.dlang.org/show_bug.cgi?id=24401
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return (() @trusted => 0)();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue