aboutsummaryrefslogtreecommitdiff
path: root/gold/arm.cc
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2011-11-10 00:41:53 +0000
committerDoug Kwan <dougkwan@google.com>2011-11-10 00:41:53 +0000
commit2c339f710d5c9dfa791386e1982c20cb09a334ad (patch)
tree5d0edca5ee677c244ecbdac42c64f540ea305d90 /gold/arm.cc
parenteac29d46b776d0ac11961376f49c207f34eb5ebd (diff)
downloadgdb-2c339f710d5c9dfa791386e1982c20cb09a334ad.zip
gdb-2c339f710d5c9dfa791386e1982c20cb09a334ad.tar.gz
gdb-2c339f710d5c9dfa791386e1982c20cb09a334ad.tar.bz2
2011-11-09 Doug Kwan <dougkwan@google.com>
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.
Diffstat (limited to 'gold/arm.cc')
-rw-r--r--gold/arm.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gold/arm.cc b/gold/arm.cc
index 200c371..a17469b 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -2075,7 +2075,8 @@ class Arm_scan_relocatable_relocs :
case elfcpp::R_ARM_TARGET1:
case elfcpp::R_ARM_TARGET2:
gold_unreachable();
- // Relocations that write full 32 bits.
+ // Relocations that write full 32 bits and
+ // have alignment of 1.
case elfcpp::R_ARM_ABS32:
case elfcpp::R_ARM_REL32:
case elfcpp::R_ARM_SBREL32:
@@ -2093,7 +2094,7 @@ class Arm_scan_relocatable_relocs :
case elfcpp::R_ARM_TLS_LDO32:
case elfcpp::R_ARM_TLS_IE32:
case elfcpp::R_ARM_TLS_LE32:
- return Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_4;
+ return Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_4_UNALIGNED;
default:
// For all other static relocations, return RELOC_SPECIAL.
return Relocatable_relocs::RELOC_SPECIAL;