https://bugs.llvm.org/show_bug.cgi?id=50148
Bug ID: 50148
Summary: [X32] Wrong exception table generation
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
$ clang++ --version
clang version 11.1.0
Target: x86_64-unknown-linux-gnux32
Thread model: posix
InstalledDir: /usr/bin
$ cat test.ii
class E {};
void f();
void g() throw(E) { f(); }
$ clang++ -mx32 -c -O2 test.ii
$ objdump -rj .gcc_except_table test.o
test.o: file format elf32-x86-64
RELOCATION RECORDS FOR [.gcc_except_table]:
OFFSET TYPE VALUE
00000010 R_X86_64_32 _ZTI1E
$ clang++ -mx32 -c -O2 -fPIC test.ii
$ objdump -rj .gcc_except_table test.o
test.o: file format elf32-x86-64
RELOCATION RECORDS FOR [.gcc_except_table]:
OFFSET TYPE VALUE
00000010 R_X86_64_PC64 .data
With -fPIC we suddenly have a 64-bit relocation. That's wrong and causes a
linker error later on.
The above is tested with LLVM 11 with various cherry-picked patches from LLVM
12, but this is still an issue on LLVM 12 and trunk as well. Reporting to make
sure I don't forget about it, assigning to myself.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs