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: Tue, 19 Jun 2012 06:47:46 -0700
On Jun 19, 2012, at 12:30 AM, Jean-Denis MUYS <email@hidden> wrote:
>
> On 19 juin 2012, at 01:33, Dave Zarzycki wrote:
>
>> This is your bug (it even generates the same error):
>>
>> #pragma GCC visibility push(hidden)
>> #include <stdio.h>
>> #pragma GCC visibility pop
>> int main(void) { printf("%p\n", stdout); return 0; }
>>
>> Do not pragma push visibility before including headers.
>>
>> davez
>>
>
> Any idea why? as written, this is voodoo! I can't see the relation between visibility and position independent code.
When the visibility of a global variable is hidden, the compiler optimize access to it. Therefore, by changing the default visibility to hidden before including headers, we trick the compiler into thinking that library globals like "stdout" are located in our process, when they are not.
davez
_______________________________________________
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