From adc7571d319f150964da9eb81db6f0a1f9dfcf82 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 9 Jun 2011 05:51:11 +0000 Subject: Allow building x32 DSO from x86-64 object file. bfd/ 2011-06-08 H.J. Lu * elf64-x86-64.c (elf_x86_64_check_relocs): Allow R_X86_64_64 relocations in SEC_DEBUGGING sections when building shared libraries. ld/testsuite/ 2011-06-08 H.J. Lu * ld-x86-64/simple.c: New. * ld-x86-64/x86-64-x32.rd: Likewise. * ld-x86-64/x86-64.exp: Check building x32 DSO from x86-64 object file. --- bfd/elf64-x86-64.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bfd/elf64-x86-64.c') diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 9d6d4a4..72a7cc1 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1217,6 +1217,13 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, break; case R_X86_64_64: + /* Allow R_X86_64_64 relocations in SEC_DEBUGGING sections + when building shared libraries. */ + if (info->shared + && !info->executable + && (sec->flags & SEC_DEBUGGING) != 0) + break; + case R_X86_64_DTPOFF64: case R_X86_64_TPOFF64: case R_X86_64_PC64: -- cgit v1.1