diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-07-03 17:57:25 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-07-03 17:57:25 +0000 |
commit | 3004a68c469b847122e497e90d0d73dc8422e427 (patch) | |
tree | c7c1d610ab0773c8e46b4cdf27fb918185396091 /bfd/elfcode.h | |
parent | 6ff9c0519cc77f9007db0ecfea11a5c558b35f3a (diff) | |
download | gdb-3004a68c469b847122e497e90d0d73dc8422e427.zip gdb-3004a68c469b847122e497e90d0d73dc8422e427.tar.gz gdb-3004a68c469b847122e497e90d0d73dc8422e427.tar.bz2 |
* elfcode.h (elf_link_add_object_symbols): Permit common and
indirect symbols in weakdefs BFD_ASSERT.
* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Simplify
BFD_ASSERT to permit some legal, but odd, cases.
* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r-- | bfd/elfcode.h | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 63b55f4..4c73825 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -2261,32 +2261,35 @@ elf_sort_hdrs (arg1, arg2) const Elf_Internal_Shdr *hdr1 = *(const Elf_Internal_Shdr **) arg1; const Elf_Internal_Shdr *hdr2 = *(const Elf_Internal_Shdr **) arg2; -#define TOEND(x) (((x)->sh_flags & SHF_ALLOC)==0) +#define TOEND(x) (((x)->sh_flags & SHF_ALLOC)==0) - if (TOEND(hdr1)) - if (TOEND(hdr2)) + if (TOEND (hdr1)) + if (TOEND (hdr2)) return 0; else return 1; - if (TOEND(hdr2)) - return -1; + if (TOEND (hdr2)) + return -1; - if (hdr1->sh_addr < hdr2->sh_addr) - return -1; - else if (hdr1->sh_addr > hdr2->sh_addr) - return 1; - /* Put !SHT_NOBITS sections before SHT_NOBITS ones. - The main loop in map_program_segments requires this. */ - ret = (hdr1->sh_type == SHT_NOBITS) - (hdr2->sh_type == SHT_NOBITS); - if (ret != 0) - return ret; + if (hdr1->sh_addr < hdr2->sh_addr) + return -1; + else if (hdr1->sh_addr > hdr2->sh_addr) + return 1; + + /* Put !SHT_NOBITS sections before SHT_NOBITS ones. + The main loop in map_program_segments requires this. */ + + ret = (hdr1->sh_type == SHT_NOBITS) - (hdr2->sh_type == SHT_NOBITS); + + if (ret != 0) + return ret; if (hdr1->sh_size < hdr2->sh_size) - return -1; + return -1; if (hdr1->sh_size > hdr2->sh_size) - return 1; - return 0; - } + return 1; + return 0; +} @@ -4696,7 +4699,9 @@ elf_link_add_object_symbols (abfd, info) hlook->weakdef = NULL; BFD_ASSERT (hlook->root.type == bfd_link_hash_defined - || hlook->root.type == bfd_link_hash_defweak); + || hlook->root.type == bfd_link_hash_defweak + || hlook->root.type == bfd_link_hash_common + || hlook->root.type == bfd_link_hash_indirect); slook = hlook->root.u.def.section; vlook = hlook->root.u.def.value; |