bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/29655] s390x gas generates PC32DBL instead of PLT32DBL for func


From: krebbel at linux dot ibm.com
Subject: [Bug gas/29655] s390x gas generates PC32DBL instead of PLT32DBL for function call
Date: Fri, 07 Oct 2022 10:35:04 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29655

--- Comment #12 from Andreas Krebbel <krebbel at linux dot ibm.com> ---
So do I understand it correctly that for the Qt case the example would look
more like this:

test2.c:

#include <stdio.h>

void alias () __attribute__ ((weak, alias ("bar")));
void bar() { printf("bar=%p alias=%p\n", bar, alias); }

test1.c:

void bar();
// void *get_bar_addr() { return bar; }
int main() { bar(); }


which gives the expected result on x86 (with line 2 commented out):
bar=0x7f1e4cdb4109 alias=0x7f1e4cdb4109

but not on s390x because we always resolve to the PLT slot:
bar=0x10004b8 alias=0x3fffdf00640

On the other hand the behavior Qt is relying on depends on whether the address
of bar is taken in main. So by uncommenting line 2 the problem occurs also on
x86:

bar=0x401030 alias=0x7f63ae84a109

Neither target appears to guarantee that aliases behave the same wrt pointer
equality. On non-s390x targets it only works because Qt happens to trigger a
case where it accidentally matches.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]