[PATCH] D63121: [ELF] Make the rule to create relative relocations in a writable section stricter
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 12 10:34:34 PDT 2019
peter.smith added a comment.
Reproducer:
cat init.cpp
template <class T>
struct Bar {
T X;
Bar(T X) : X(X) {}
};
Foo<int> F(0);
Bar<int> B(1);
int func(void) {
return F.X + B.X;
}
clang --target=arm-linux-gnueabihf init.cpp -fpic --shared -o init.so -fuse-ld=lld
llvm-readobj --relocs init.so
File: init.so
Format: ELF32-arm-little
Arch: arm
AddressSize: 32bit
LoadName:
Relocations [
Section (6) .rel.dyn {
0x2000 R_ARM_RELATIVE - 0x0
0x2008 R_ARM_RELATIVE - 0x0
0x3000 R_ARM_RELATIVE - 0x0
0x2004 R_ARM_ABS32 - 0x0
0x20D8 R_ARM_GLOB_DAT __gmon_start__ 0x0
0x20DC R_ARM_GLOB_DAT _ITM_deregisterTMCloneTable 0x0
0x20E0 R_ARM_GLOB_DAT _ITM_registerTMCloneTable 0x0
0x20E4 R_ARM_GLOB_DAT __cxa_finalize at GLIBC_2.4 0x0
0x20E8 R_ARM_GLOB_DAT _Jv_RegisterClasses 0x0
0x20EC R_ARM_GLOB_DAT B 0x0
0x20F0 R_ARM_GLOB_DAT F 0x0
}
Section (8) .rel.plt {
0x3010 R_ARM_JUMP_SLOT __gmon_start__ 0x0
0x3014 R_ARM_JUMP_SLOT __cxa_finalize at GLIBC_2.4 0x0
0x3018 R_ARM_JUMP_SLOT _ZN3FooIiEC2Ei 0x0
0x301C R_ARM_JUMP_SLOT _ZN3BarIiEC2Ei 0x0
}
]
Note the 0x2004 R_ARM_ABS32 - 0x0 which is is in the .init_array section.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63121/new/
https://reviews.llvm.org/D63121
More information about the llvm-commits
mailing list