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: Dave Zarzycki <email@hidden>
- Date: Wed, 13 Jun 2012 06:02:12 -0700
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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden