aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2015-08-11 22:12:41 +0100
committerJiong Wang <jiong.wang@arm.com>2015-08-11 22:12:41 +0100
commitc674f5cd3f900c5b12996ea5188ff818fe9eb6bc (patch)
tree38f77c161baebe61026656b1820e9275502318ec
parentb261b4db940297f254280ef57589879341d09435 (diff)
downloadgdb-c674f5cd3f900c5b12996ea5188ff818fe9eb6bc.zip
gdb-c674f5cd3f900c5b12996ea5188ff818fe9eb6bc.tar.gz
gdb-c674f5cd3f900c5b12996ea5188ff818fe9eb6bc.tar.bz2
[AArch64] Improve BFD overflow warning message for -fpic
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfnn-aarch64.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4b70d83..1e02625 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2015-08-11 Jiong Wang <jiong.wang@arm.com>
+ * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning
+ message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
+
+2015-08-11 Jiong Wang <jiong.wang@arm.com>
+
* elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New.
(aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 1796ecd..fe10be6 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -5802,6 +5802,9 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
if (r != bfd_reloc_ok && r != bfd_reloc_continue)
{
+ bfd_reloc_code_real_type real_r_type
+ = elfNN_aarch64_bfd_reloc_from_type (r_type);
+
switch (r)
{
case bfd_reloc_overflow:
@@ -5809,6 +5812,16 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
(info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset))
return FALSE;
+ if (real_r_type == BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
+ || real_r_type == BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14)
+ {
+ (*info->callbacks->warning)
+ (info,
+ _("Too many GOT entries for -fpic, "
+ "please recompile with -fPIC"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
break;
case bfd_reloc_undefined: