[llvm] [ARM] mlong-calls generate PIC code using GOT #39970 (PR #147313)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 08:07:12 PDT 2025


jiangxuezhi wrote:

e.g.
the command is clang -O2 -mlong-calls -fPIC

the code is:
#include <stdio.h>

int main()
{
    printf("hello");
    return 0;
}

the Relocation section is:
 Offset     Info    Type                Sym. Value  Symbol's Name
00000020  00000503 R_ARM_REL32            00000000   .L.str
00000024  00000760 R_ARM_GOT_PREL         00000000   printf

Relocation section '.rel.ARM.exidx' at offset 0x1a8 contains 1 entry:
 Offset     Info    Type                Sym. Value  Symbol's Name
00000000  0000022a R_ARM_PREL31           00000000   .text


https://github.com/llvm/llvm-project/pull/147313


More information about the llvm-commits mailing list