From 2c339f710d5c9dfa791386e1982c20cb09a334ad Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Thu, 10 Nov 2011 00:41:53 +0000 Subject: 2011-11-09 Doug Kwan PR gold/13362 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs): Use unaligned 4-byte relocs for static 32-bit data as required by EABI. * reloc.h (Relocatable_relocs::Reloc_strategy): New enum RELOC_ADJUST_FOR_SECTION_4_UNALIGNED. (Relocate_functions::rel_unaligned): New. (Relocate_functions::rel32_unaligned): New. * target-reloc.h (relocate_for_relocatable): Add code to handle RELOC_ADJUST_FOR_SECTION_4_UNALIGNED. * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout, arm_unaligned_reloc_r): New targets. * testsuite/Makefile.in: Regenerate. * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable linking. --- gold/target-reloc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gold/target-reloc.h') diff --git a/gold/target-reloc.h b/gold/target-reloc.h index 832c5d6..464a3fa 100644 --- a/gold/target-reloc.h +++ b/gold/target-reloc.h @@ -669,6 +669,7 @@ relocate_for_relocatable( case Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_2: case Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_4: case Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_8: + case Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_4_UNALIGNED: { // We are adjusting a section symbol. We need to find // the symbol table index of the section symbol for @@ -790,6 +791,12 @@ relocate_for_relocatable( psymval); break; + case Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_4_UNALIGNED: + Relocate_functions::rel32_unaligned(padd, + object, + psymval); + break; + default: gold_unreachable(); } -- cgit v1.1