aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-sparc.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2006-01-31 22:42:21 +0000
committerEric Botcazou <ebotcazou@libertysurf.fr>2006-01-31 22:42:21 +0000
commitdc669dc8482c03a867487a1a47f7ba93791e27b2 (patch)
tree0acbf127315de53d0d5ffb000b82a9f9a38d8854 /bfd/elfxx-sparc.c
parent4b5bd4e780a4e43e5adb63d4fa50c348a1bafdce (diff)
downloadgdb-dc669dc8482c03a867487a1a47f7ba93791e27b2.zip
gdb-dc669dc8482c03a867487a1a47f7ba93791e27b2.tar.gz
gdb-dc669dc8482c03a867487a1a47f7ba93791e27b2.tar.bz2
* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
for 32-bit relocs overflow.
Diffstat (limited to 'bfd/elfxx-sparc.c')
-rw-r--r--bfd/elfxx-sparc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index e587a67..5e8fb20 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -3357,6 +3357,21 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
{
const char *name;
+ /* The Solaris native linker silently disregards overflows.
+ We don't, but this breaks stabs debugging info, whose
+ relocations are only 32-bits wide. Ignore overflows in
+ this case and also for discarded entries. */
+ if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32)
+ && (((input_section->flags & SEC_DEBUGGING) != 0
+ && strcmp (bfd_section_name (input_bfd,
+ input_section),
+ ".stab") == 0)
+ || _bfd_elf_section_offset (output_bfd, info,
+ input_section,
+ rel->r_offset)
+ == (bfd_vma)-1))
+ break;
+
if (h != NULL)
name = NULL;
else