aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-06-09 05:51:11 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-06-09 05:51:11 +0000
commitadc7571d319f150964da9eb81db6f0a1f9dfcf82 (patch)
tree80e34ba57045e83150fcfdb39df827886f536c75 /bfd/elf64-x86-64.c
parent240077501163f169043c1d87ce05cd57f0e9ee3a (diff)
downloadgdb-adc7571d319f150964da9eb81db6f0a1f9dfcf82.zip
gdb-adc7571d319f150964da9eb81db6f0a1f9dfcf82.tar.gz
gdb-adc7571d319f150964da9eb81db6f0a1f9dfcf82.tar.bz2
Allow building x32 DSO from x86-64 object file.
bfd/ 2011-06-08 H.J. Lu <hongjiu.lu@intel.com> * 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 <hongjiu.lu@intel.com> * 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.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c7
1 files changed, 7 insertions, 0 deletions
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: