| | |
| --- | --- |
| Bugzilla Link | [40624](https://llvm.org/bz40624) |
| Version | unspecified |
| OS | Linux |
| CC | @froydnj |
## Extended Description
With the following source:
```
extern __attribute__((visibility("hidden"))) int foo();
int bar() { return foo(); };
```
clang generates the following with -fPIC -mlong-calls -O3 --target=armv7a-linux-gnueabi:
```
bar:
ldr r0, .LCPI0_0
bx r0
.LCPI0_0:
.long foo
```
That is not PIC, as that .LCPI0_0 label is in .text.
GCC generates the following:
```
bar:
ldr r3, .L3
.LPIC0:
add r3, pc, r3
bx r3
.L3:
.word foo-(.LPIC0+8)
```
(All courtesy of godbolt)
https://godbolt.org/z/gKwbiO
Extended Description
With the following source:
clang generates the following with -fPIC -mlong-calls -O3 --target=armv7a-linux-gnueabi:
That is not PIC, as that .LCPI0_0 label is in .text.
GCC generates the following:
(All courtesy of godbolt)
https://godbolt.org/z/gKwbiO