diff options
author | Jie Zhang <jie.zhang@analog.com> | 2009-09-23 08:03:02 +0000 |
---|---|---|
committer | Jie Zhang <jie.zhang@analog.com> | 2009-09-23 08:03:02 +0000 |
commit | d3e32c2e1a412bdf38f9870c7b8e7377ec6a227e (patch) | |
tree | 0c36c6d83e0e0a31b6e2eb58af771988f651e93f /bfd | |
parent | a3371076af12586b4d0544dbdc12df2f670afbe3 (diff) | |
download | gdb-d3e32c2e1a412bdf38f9870c7b8e7377ec6a227e.zip gdb-d3e32c2e1a412bdf38f9870c7b8e7377ec6a227e.tar.gz gdb-d3e32c2e1a412bdf38f9870c7b8e7377ec6a227e.tar.bz2 |
* elf32-bfin.c (_bfinfdpic_size_got_plt): Make sure empty
.rel.plt and .plt sections are removed.
(elf32_bfinfdpic_size_dynamic_sections): Remove empty .dynbss
section. Remove the duplicated removing of empty .rel.plt
section.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf32-bfin.c | 46 |
2 files changed, 28 insertions, 26 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f750beb..09194ce 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2009-09-23 Jie Zhang <jie.zhang@analog.com> + + * elf32-bfin.c (_bfinfdpic_size_got_plt): Make sure empty + .rel.plt and .plt sections are removed. + (elf32_bfinfdpic_size_dynamic_sections): Remove empty .dynbss + section. Remove the duplicated removing of empty .rel.plt + section. + 2009-09-21 Richard Sandiford <rdsandiford@googlemail.com> * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Extend previous diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index d4e3bbb..a767749 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -4166,19 +4166,17 @@ _bfinfdpic_size_got_plt (bfd *output_bfd, } if (elf_hash_table (info)->dynamic_sections_created) + bfinfdpic_pltrel_section (info)->size = + gpinfop->g.lzplt / LZPLT_NORMAL_SIZE * get_elf_backend_data (output_bfd)->s->sizeof_rel; + if (bfinfdpic_pltrel_section (info)->size == 0) + bfinfdpic_pltrel_section (info)->flags |= SEC_EXCLUDE; + else { - bfinfdpic_pltrel_section (info)->size = - gpinfop->g.lzplt / LZPLT_NORMAL_SIZE * get_elf_backend_data (output_bfd)->s->sizeof_rel; - if (bfinfdpic_pltrel_section (info)->size == 0) - bfinfdpic_pltrel_section (info)->flags |= SEC_EXCLUDE; - else - { - bfinfdpic_pltrel_section (info)->contents = - (bfd_byte *) bfd_zalloc (dynobj, - bfinfdpic_pltrel_section (info)->size); - if (bfinfdpic_pltrel_section (info)->contents == NULL) - return FALSE; - } + bfinfdpic_pltrel_section (info)->contents = + (bfd_byte *) bfd_zalloc (dynobj, + bfinfdpic_pltrel_section (info)->size); + if (bfinfdpic_pltrel_section (info)->contents == NULL) + return FALSE; } /* Add 4 bytes for every block of at most 65535 lazy PLT entries, @@ -4215,18 +4213,15 @@ _bfinfdpic_size_got_plt (bfd *output_bfd, /* Allocate the PLT section contents only after _bfinfdpic_assign_plt_entries has a chance to add the size of the non-lazy PLT entries. */ - if (elf_hash_table (info)->dynamic_sections_created) + if (bfinfdpic_plt_section (info)->size == 0) + bfinfdpic_plt_section (info)->flags |= SEC_EXCLUDE; + else { - if (bfinfdpic_plt_section (info)->size == 0) - bfinfdpic_plt_section (info)->flags |= SEC_EXCLUDE; - else - { - bfinfdpic_plt_section (info)->contents = - (bfd_byte *) bfd_zalloc (dynobj, - bfinfdpic_plt_section (info)->size); - if (bfinfdpic_plt_section (info)->contents == NULL) - return FALSE; - } + bfinfdpic_plt_section (info)->contents = + (bfd_byte *) bfd_zalloc (dynobj, + bfinfdpic_plt_section (info)->size); + if (bfinfdpic_plt_section (info)->contents == NULL) + return FALSE; } return TRUE; @@ -4302,12 +4297,11 @@ elf32_bfinfdpic_size_dynamic_sections (bfd *output_bfd, return FALSE; } - - s = bfd_get_section_by_name (dynobj, ".rela.bss"); + s = bfd_get_section_by_name (dynobj, ".dynbss"); if (s && s->size == 0) s->flags |= SEC_EXCLUDE; - s = bfd_get_section_by_name (dynobj, ".rel.plt"); + s = bfd_get_section_by_name (dynobj, ".rela.bss"); if (s && s->size == 0) s->flags |= SEC_EXCLUDE; |