From 1da80baa66a91a51d46a48476dbc14b26eaf8f78 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 10 May 2012 17:15:19 +0000 Subject: [PATCH] Count R_X86_64_RELATIVE64 as reloc_class_relative bfd/ * elf64-x86-64.c (elf_x86_64_reloc_type_class): Handle R_X86_64_RELATIVE64. ld/testsuite/ * ld-x86-64/pr13082-1a.d: Check RELACOUNT. * ld-x86-64/pr13082-1b.d: Likewise. --- bfd/ChangeLog | 5 +++++ bfd/elf64-x86-64.c | 1 + ld/testsuite/ChangeLog | 5 +++++ ld/testsuite/ld-x86-64/pr13082-1a.d | 6 +++++- ld/testsuite/ld-x86-64/pr13082-1b.d | 6 +++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ee2c264a5b..fa2f5fa832 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2012-05-10 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_reloc_type_class): Handle + R_X86_64_RELATIVE64. + 2012-05-09 H.J. Lu * elf64-x86-64.c (elf_x86_64_relocate_section): Check addend diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 8eafbf084c..a9429b8c6c 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -4524,6 +4524,7 @@ elf_x86_64_reloc_type_class (const Elf_Internal_Rela *rela) switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_X86_64_RELATIVE: + case R_X86_64_RELATIVE64: return reloc_class_relative; case R_X86_64_JUMP_SLOT: return reloc_class_plt; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 34e8d62aac..1cd1b4ebbe 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-05-10 H.J. Lu + + * ld-x86-64/pr13082-1a.d: Check RELACOUNT. + * ld-x86-64/pr13082-1b.d: Likewise. + 2012-05-09 H.J. Lu * ld-x86-64/ilp32-11.d: New file. diff --git a/ld/testsuite/ld-x86-64/pr13082-1a.d b/ld/testsuite/ld-x86-64/pr13082-1a.d index f0e98ffc90..cb404e0af8 100644 --- a/ld/testsuite/ld-x86-64/pr13082-1a.d +++ b/ld/testsuite/ld-x86-64/pr13082-1a.d @@ -2,8 +2,12 @@ #name: PR ld/13082-1 (a) #as: --x32 #ld: -shared -melf32_x86_64 -#readelf: -r --wide +#readelf: -d -r --wide +Dynamic section at offset 0x[0-9a-f]+ contains [0-9]+ entries: +#... + 0x[0-9a-f]+ +\(RELACOUNT\) +1 +#... Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries: Offset Info Type Sym. Value Symbol's Name \+ Addend [0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE64 +[0-9a-f]+ diff --git a/ld/testsuite/ld-x86-64/pr13082-1b.d b/ld/testsuite/ld-x86-64/pr13082-1b.d index f10481f85e..dbe8a0a88f 100644 --- a/ld/testsuite/ld-x86-64/pr13082-1b.d +++ b/ld/testsuite/ld-x86-64/pr13082-1b.d @@ -2,8 +2,12 @@ #name: PR ld/13082-1 (b) #as: --x32 #ld: -pie -melf32_x86_64 -#readelf: -r --wide +#readelf: -d -r --wide +Dynamic section at offset 0x[0-9a-f]+ contains [0-9]+ entries: +#... + 0x[0-9a-f]+ +\(RELACOUNT\) +1 +#... Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries: Offset Info Type Sym. Value Symbol's Name \+ Addend [0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE64 +[0-9a-f]+