ZhiyaoMa98 added a comment. Unfortunately, `-fPIE` seems not to be generating the PLT on LLVM for embedded ARM.
C source file (test.c): extern void bar(void); void foo(void) { bar(); } LLVM with `clang -O2 -fPIE -fsemantic-interposition -mlong-calls --target=armv7em-none-eabi -c test.c`: 00000000 <foo>: 0: 4800 ldr r0, [pc, #0] ; (4 <foo+0x4>) 2: 4700 bx r0 4: 00000000 .word 0x00000000 ARM GNU with `arm-none-eabi-gcc -O2 -fPIE -mlong-calls -msingle-pic-base -mcpu=cortex-m4 -c test.c`: 00000000 <foo>: 0: 4b01 ldr r3, [pc, #4] ; (8 <foo+0x8>) 2: f859 3003 ldr.w r3, [r9, r3] 6: 4718 bx r3 8: 00000000 .word 0x00000000 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136203/new/ https://reviews.llvm.org/D136203 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits