Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3894)

Unified Diff: binutils/bfd/elf64-x86-64.c

Issue 4128004: [binutils] Special processing of R_X86_64_32 relocations (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: binutils/bfd/elf64-x86-64.c
diff --git a/binutils/bfd/elf64-x86-64.c b/binutils/bfd/elf64-x86-64.c
index 5f57be07d0ff34eed240693e46997aade4be6369..b8527e1ab8e82b3aa2b376243a70f2917437e27b 100644
--- a/binutils/bfd/elf64-x86-64.c
+++ b/binutils/bfd/elf64-x86-64.c
@@ -3292,10 +3292,18 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
sindx = elf_section_data (osec)->dynindx;
if (sindx == 0)
{
- asection *oi = htab->elf.text_index_section;
- sindx = elf_section_data (oi)->dynindx;
+ osec = htab->elf.text_index_section;
+ sindx = elf_section_data (osec)->dynindx;
}
BFD_ASSERT (sindx != 0);
+#ifdef ELF64_NACL_C
+ /* For NaCl, R_X86_64_32 comes in place of
+ R_X86_64_64. We don't have R_X86_32_RELATIVE to
+ make a rewrite similar to one above, so just make
+ a non-buggy relocation against section symbol. */
+ if (r_type == R_X86_64_32)
+ relocation -= osec->vma;
+#endif
}
outrel.r_info = ELF64_R_INFO (sindx, r_type);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698