[X86] Add support for R_X86_64_GOTPC32 relocation#1344
Draft
Saharsh Burra (bsaharsh) wants to merge 1 commit into
Draft
[X86] Add support for R_X86_64_GOTPC32 relocation#1344Saharsh Burra (bsaharsh) wants to merge 1 commit into
Saharsh Burra (bsaharsh) wants to merge 1 commit into
Conversation
Add handling for R_X86_64_GOTPC32 (type 26) in the ELD x86-64 backend. This relocation is emitted for `leaq _GLOBAL_OFFSET_TABLE_(%rip), %rbx` to compute the GOT base address, which is then used by PIC/PIE code for GOT-relative accesses. Changes: - x86_64RelocationInfo.h: add GOTPC32 entry at index 26 with Size=32 - x86_64RelocationFunctions.h: declare relocGOTPC32, wire dispatch table - x86_64Relocator.cpp: add isRelocSupported case, bare return scan cases, and relocGOTPC32 apply function implementing GOT_base + A - P Note: This patch depends on PR qualcomm#1123 which adds _GLOBAL_OFFSET_TABLE_ symbol support for x86-64. Without that patch, GOTPC32 relocations will fail with an undefined reference to _GLOBAL_OFFSET_TABLE_. Resolves qualcomm#1304 Signed-off-by: bsaharsh <bsaharsh@qti.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add handling for R_X86_64_GOTPC32 (type 26) in the ELD x86-64 backend. This relocation is emitted for
leaq _GLOBAL_OFFSET_TABLE_(%rip), %rbxto compute the GOT base address, which is then used by PIC/PIE code for GOT-relative accesses.Changes:
Note: This patch depends on PR #1123 which adds GLOBAL_OFFSET_TABLE symbol support for x86-64. Without that patch, GOTPC32 relocations will fail with an undefined reference to GLOBAL_OFFSET_TABLE.
Resolves #1304