https://bugs.llvm.org/show_bug.cgi?id=49525
Bug ID: 49525
Summary: 'P' inline assembly operand modifier should obey
-fno-plt
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
Assignee: unassignedb...@nondot.org
Reporter: thi...@kde.org
CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, pengfei.w...@intel.com,
spatel+l...@rotateright.com
Unlike GCC, Clang seems not to print the "@PLT" suffix for the 'P' constraint
in PIC mode:
$ cat test.c
extern void f(void);
void g() { asm("call %P0 # asm" : : "X" (f)); }
int h() { f(); return 0; }
$ clang -fno-pic -S -o - -O2 test.c | grep call
callq f # asm
callq f
$ clang -fPIC -S -o - -O2 test.c | grep call
callq f # asm
callq f@PLT
$ gcc -fPIC -S -o - -O2 test.c | grep call
call f@PLT # asm
call f@PLT
That's not a big deal because the linker will generate the PLT anyway if the
function is defined in a shared library being linked.
But the call violates -fno-plt:
$ clang -fno-pic -S -o - -O2 test.c | grep call
callq f # asm
callq *f@GOTPCREL(%rip)
$ clang -fPIC -S -o - -O2 test.c | grep call
callq f # asm
callq *f@GOTPCREL(%rip)
$ gcc -fPIC -S -o - -O2 test.c | grep call
call f@PLT # asm
call *f@GOTPCREL(%rip)
Equivalent GCC bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99530
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs