mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
[BOLT] Add support for *GOTPCRELX relocation type.
Summary: gcc5 can generate new types of relocations that give linker a freedom to substitute instructions. These relocations are PC-relative, and since we manually process such relocations they don't present much of a problem. Additionally, detect non-pc-relative access from code into a middle of a function. Occasionally I've seen such code, but don't know exactly how to trigger its generation. Just issue a warning for now. (cherry picked from FBD4566473)
This commit is contained in:
@@ -3834,6 +3834,8 @@ size_t Relocation::getSizeForType(uint64_t Type) {
|
||||
case ELF::R_X86_64_GOTPCREL:
|
||||
case ELF::R_X86_64_GOTTPOFF:
|
||||
case ELF::R_X86_64_TPOFF32:
|
||||
case ELF::R_X86_64_GOTPCRELX:
|
||||
case ELF::R_X86_64_REX_GOTPCRELX:
|
||||
return 4;
|
||||
case ELF::R_X86_64_PC64:
|
||||
case ELF::R_X86_64_64:
|
||||
@@ -3857,6 +3859,8 @@ bool Relocation::isPCRelative(uint64_t Type) {
|
||||
case ELF::R_X86_64_GOTPCREL:
|
||||
case ELF::R_X86_64_PLT32:
|
||||
case ELF::R_X86_64_GOTTPOFF:
|
||||
case ELF::R_X86_64_GOTPCRELX:
|
||||
case ELF::R_X86_64_REX_GOTPCRELX:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user