aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-08-03 16:40:25 +0000
committerIan Lance Taylor <ian@airs.com>1999-08-03 16:40:25 +0000
commit2d14625061ad9955fdd49aeb0ff47cd62d7bcdca (patch)
tree826ccf1bed0c560bbb39c0f0fe0c3eba7feda31f
parentcb94091feb21bf1115a389e2864ed484e951a0d7 (diff)
downloadgdb-2d14625061ad9955fdd49aeb0ff47cd62d7bcdca.zip
gdb-2d14625061ad9955fdd49aeb0ff47cd62d7bcdca.tar.gz
gdb-2d14625061ad9955fdd49aeb0ff47cd62d7bcdca.tar.bz2
* elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation
value of a symbol in a SEC_DEBUGGING section. Warn when doing a relocation against a symbol in an input section with no output section. From Daniel Jacobowitz <drow@false.org>.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-ppc.c15
2 files changed, 19 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e17368a..487589a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
1999-08-03 Ian Lance Taylor <ian@zembu.com>
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation
+ value of a symbol in a SEC_DEBUGGING section. Warn when doing a
+ relocation against a symbol in an input section with no output
+ section. From Daniel Jacobowitz <drow@false.org>.
+
* coff-stgo32.c (go32_stubbed_coff_object_p): Remove; not used.
* acinclude.m4 (BFD_CC_FOR_BUILD): Change to use conftest, and to
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 83689c2..1de197b 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3038,7 +3038,12 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& ((! info->symbolic && h->dynindx != -1)
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0)
- && (input_section->flags & SEC_ALLOC) != 0
+ && ((input_section->flags & SEC_ALLOC) != 0
+ /* Testing SEC_DEBUGGING here may be wrong.
+ It's here to avoid a crash when
+ generating a shared library with DWARF
+ debugging information. */
+ || (input_section->flags & SEC_DEBUGGING) != 0)
&& (r_type == R_PPC_ADDR32
|| r_type == R_PPC_ADDR24
|| r_type == R_PPC_ADDR16
@@ -3081,6 +3086,14 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
obscure cases sec->output_section will be NULL. */
relocation = 0;
}
+ else if (sec->output_section == NULL)
+ {
+ (*_bfd_error_handler)
+ (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
+ bfd_get_filename (input_bfd), h->root.root.string,
+ bfd_get_section_name (input_bfd, input_section));
+ relocation = 0;
+ }
else
relocation = (h->root.u.def.value
+ sec->output_section->vma