Re: OS constant cause "32-bit RIP relative reference out of range" linker error on x64
Re: OS constant cause "32-bit RIP relative reference out of range" linker error on x64
- Subject: Re: OS constant cause "32-bit RIP relative reference out of range" linker error on x64
- From: Vojtěch Meluzín <email@hidden>
- Date: Mon, 18 Jun 2012 18:05:40 +0200
No help so far...
It seems that CLANG doesn't cause this error when there is just a small source code. So I tried to divide the source codes into small parts, this time this is the error...
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in __ZN14MConsoleStreamC2Ev from /Users/melda/Library/Developer/Xcode/DerivedData/console-elzukurmumezgoaajfaamjcaoeol/Build/Intermediates/console.build/Debug/console.build/Objects-normal/x86_64/mlibrary_part_2.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
final section layout:
__TEXT/__text addr=0x100001000, size=0x0015B280, fileOffset=0x00001000, type=1
__TEXT/__stubs addr=0x10015C280, size=0x000003FC, fileOffset=0x0015C280, type=27
__TEXT/__stub_helper addr=0x10015C67C, size=0x000006B4, fileOffset=0x0015C67C, type=31
__TEXT/__gcc_except_tab addr=0x10015CD30, size=0x0004DA10, fileOffset=0x0015CD30, type=0
__TEXT/__const addr=0x1001AA740, size=0x00007E00, fileOffset=0x001AA740, type=0
__TEXT/__cstring addr=0x1001B2540, size=0x0000A2E8, fileOffset=0x001B2540, type=12
__TEXT/__unwind_info addr=0x1001BC828, size=0x00004214, fileOffset=0x001BC828, type=21
__TEXT/__eh_frame addr=0x1001C0A40, size=0x000235C0, fileOffset=0x001C0A40, type=18
__DATA/__program_vars addr=0x1001E4000, size=0x00000028, fileOffset=0x001E4000, type=29
__DATA/__nl_symbol_ptr addr=0x1001E4028, size=0x00000010, fileOffset=0x001E4028, type=28
__DATA/__got addr=0x1001E4038, size=0x00000018, fileOffset=0x001E4038, type=28
__DATA/__la_symbol_ptr addr=0x1001E4050, size=0x00000550, fileOffset=0x001E4050, type=26
__DATA/__mod_init_func addr=0x1001E45A0, size=0x00000038, fileOffset=0x001E45A0, type=32
__DATA/__data addr=0x1001E45E0, size=0x00004950, fileOffset=0x001E45E0, type=0
__DATA/__const addr=0x1001E8F30, size=0x00001688, fileOffset=0x001E8F30, type=0
__DATA/__cfstring addr=0x1001EA5B8, size=0x00000020, fileOffset=0x001EA5B8, type=16
__DATA/__bss addr=0x1001EA5E0, size=0x00001268, fileOffset=0x00000000, type=24
__DATA/__common addr=0x1001EB850, size=0x00088681, fileOffset=0x00000000, type=24
ld: 32-bit RIP relative reference out of range (-4295071253 max is +/-4GB): from __ZN14MConsoleStreamC2Ev (0x1000195D0) to ___stdoutp@0x000DF628 (0x00000000) in __ZN14MConsoleStreamC2Ev from /Users/melda/Library/Developer/Xcode/DerivedData/console-elzukurmumezgoaajfaamjcaoeol/Build/Intermediates/console.build/Debug/console.build/Objects-normal/x86_64/mlibrary_part_2.o for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please somebody help, CLANG is essentially unusable for me now, I'm thinking about going back to the creepy GCC and leave all that work from last week, when I was trying to persuade CLANG to work...
Vojtech
2012/6/14 Vojtěch Meluzín
<email@hidden>
I tried, but no luck. I also tried a different thing - I added a small code accessing the constant or stdout for example and it was fine! So it obviously depends on which source is being compiled, but the compiler arguments should be the same. One thing is that the "problematic" source code is huge, like hundreds of thousands of lines probably. Could that be a problem? Or is there something the source code can contain to cause this? Some pragma or something...
Thanks in advance
Vojtech2012/6/13 Dave Zarzycki
<email@hidden>
Please reduce this down to a simple test case. Thanks!
On Jun 13, 2012, at 4:16 AM, Vojtěch Meluzín <
email@hidden> wrote:
> Hi,
>
> I'm trying to make x64 work on XCode 4 Mac OS 10.7, but whenever I use a system constant, such as kCFAllocatorDefault, I get this linker error (on x86 it works fine):
>
>
> ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in __ZN10MClipboard3SetE7MString7MBuffer from /Users/melda/Library/Developer/Xcode/DerivedData/console-elzukurmumezgoaajfaamjcaoeol/Build/Intermediates/console.build/Debug/console.build/Objects-normal/x86_64/mlibrary_teststub.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
> final section layout:
> __TEXT/__text addr=0x1000012E0, size=0x0015B24B, fileOffset=0x000012E0, type=1
> __TEXT/__stubs addr=0x10015C52C, size=0x00000402, fileOffset=0x0015C52C, type=27
> __TEXT/__stub_helper addr=0x10015C930, size=0x000006BE, fileOffset=0x0015C930, type=31
> __TEXT/__gcc_except_tab addr=0x10015CFF0, size=0x0004DAA0, fileOffset=0x0015CFF0, type=0
> __TEXT/__const addr=0x1001AAA90, size=0x00007DDA, fileOffset=0x001AAA90, type=0
> __TEXT/__cstring addr=0x1001B286A, size=0x0000A1F0, fileOffset=0x001B286A, type=12
> __TEXT/__unwind_info addr=0x1001BCA5A, size=0x000041E8, fileOffset=0x001BCA5A, type=21
> __TEXT/__eh_frame addr=0x1001C0C48, size=0x000233B0, fileOffset=0x001C0C48, type=18
> __DATA/__program_vars addr=0x1001E4000, size=0x00000028, fileOffset=0x001E4000, type=29
> __DATA/__nl_symbol_ptr addr=0x1001E4028, size=0x00000010, fileOffset=0x001E4028, type=28
> __DATA/__got addr=0x1001E4038, size=0x00000020, fileOffset=0x001E4038, type=28
> __DATA/__la_symbol_ptr addr=0x1001E4058, size=0x00000558, fileOffset=0x001E4058, type=26
> __DATA/__mod_init_func addr=0x1001E45B0, size=0x00000010, fileOffset=0x001E45B0, type=32
> __DATA/__data addr=0x1001E45C0, size=0x00004950, fileOffset=0x001E45C0, type=0
> __DATA/__const addr=0x1001E8F10, size=0x00001688, fileOffset=0x001E8F10, type=0
> __DATA/__cfstring addr=0x1001EA598, size=0x00000020, fileOffset=0x001EA598, type=16
> __DATA/__bss addr=0x1001EA5C0, size=0x00001249, fileOffset=0x00000000, type=24
> __DATA/__common addr=0x1001EB810, size=0x00088680, fileOffset=0x00000000, type=24
> ld: 32-bit RIP relative reference out of range (-4295653407 max is +/-4GB): from __ZN10MClipboard3SetE7MString7MBuffer (0x1000A70B0) to _kCFAllocatorDefault@0x00162A88 (0x00000000) in __ZN10MClipboard3SetE7MString7MBuffer from /Users/melda/Library/Developer/Xcode/DerivedData/console-elzukurmumezgoaajfaamjcaoeol/Build/Intermediates/console.build/Debug/console.build/Objects-normal/x86_64/mlibrary_teststub.o for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>
> What is wrong with that? It does that literally with all constants, stdout for example too...
>
> Thanks in advance,
> Vojtech
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden