diff options
author | Bob Wilson <bob.wilson@acm.org> | 2006-10-11 22:16:50 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@acm.org> | 2006-10-11 22:16:50 +0000 |
commit | bf1747ded8dffe421678806d040f72d057b447e9 (patch) | |
tree | ae3608db2776e333f92b75f29b5e9f35e060cadf | |
parent | fbb00ad0216a29ee005df4c4b4e4b4af5adfb7fd (diff) | |
download | gdb-bf1747ded8dffe421678806d040f72d057b447e9.zip gdb-bf1747ded8dffe421678806d040f72d057b447e9.tar.gz gdb-bf1747ded8dffe421678806d040f72d057b447e9.tar.bz2 |
* elf32-xtensa.c (elf_xtensa_relocate_section): Return after
unresolvable relocation error.
(elf_xtensa_finish_dynamic_symbol): Set value of undefined, weak
symbols to zero.
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-xtensa.c | 26 |
2 files changed, 24 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2959a49..b7db1d8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2006-10-11 Bob Wilson <bob.wilson@acm.org> + + * elf32-xtensa.c (elf_xtensa_relocate_section): Return after + unresolvable relocation error. + (elf_xtensa_finish_dynamic_symbol): Set value of undefined, weak + symbols to zero. + 2006-10-10 Bob Wilson <bob.wilson@acm.org> * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Add DT_DEBUG diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index c93f84d..a5d76b2 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -2259,13 +2259,16 @@ elf_xtensa_relocate_section (bfd *output_bfd, if (unresolved_reloc && !((input_section->flags & SEC_DEBUGGING) != 0 && h->def_dynamic)) - (*_bfd_error_handler) - (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), - input_bfd, - input_section, - (long) rel->r_offset, - howto->name, - h->root.root.string); + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), + input_bfd, + input_section, + (long) rel->r_offset, + howto->name, + h->root.root.string); + return FALSE; + } /* There's no point in calling bfd_perform_relocation here. Just go directly to our "special function". */ @@ -2326,12 +2329,17 @@ elf_xtensa_finish_dynamic_symbol (bfd *output_bfd ATTRIBUTE_UNUSED, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { - if (h->needs_plt - && !h->def_regular) + if (h->needs_plt && !h->def_regular) { /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if (!h->ref_regular_nonweak) + sym->st_value = 0; } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ |