diff options
author | Alan Modra <amodra@gmail.com> | 2012-07-02 03:02:45 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2012-07-02 03:02:45 +0000 |
commit | 87e0a731c84e58c8a6f63b38baacbc066a70ab28 (patch) | |
tree | 601dc896674bc249c25876951867e089cfdae094 /bfd/elfxx-mips.c | |
parent | 5b0a443ab9312a117539570b3e55b2c8c468e5a7 (diff) | |
download | gdb-87e0a731c84e58c8a6f63b38baacbc066a70ab28.zip gdb-87e0a731c84e58c8a6f63b38baacbc066a70ab28.tar.gz gdb-87e0a731c84e58c8a6f63b38baacbc066a70ab28.tar.bz2 |
* elf32-m32c.c (m32c_elf_check_relocs): Use bfd_make_section
"anyway" variant when creating .plt.
(m32c_elf_relax_plt_section): Remove redundant test and unused param.
(m32c_elf_relax_section): Test SEC_LINKER_CREATED before calling
m32c_elf_relax_plt_section.
* elfxx-mips.c (mips_elf_create_got_section): Use make anyway variant
when creating .got and .got.plt.
(_bfd_mips_elf_final_link): Likewise for .rtproc, and use
bfd_get_linker_section.
* sunos.c: Similarly throughout.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index de5e9c6..4440170 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -4874,7 +4874,7 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) /* We have to use an alignment of 2**4 here because this is hardcoded in the function stub generation and in the linker script. */ - s = bfd_make_section_with_flags (abfd, ".got", flags); + s = bfd_make_section_anyway_with_flags (abfd, ".got", flags); if (s == NULL || ! bfd_set_section_alignment (abfd, s, 4)) return FALSE; @@ -4926,9 +4926,11 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL; /* We also need a .got.plt section when generating PLTs. */ - s = bfd_make_section_with_flags (abfd, ".got.plt", - SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY | SEC_LINKER_CREATED); + s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", + SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED); if (s == NULL) return FALSE; htab->sgotplt = s; @@ -13309,15 +13311,15 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info) if (SGI_COMPAT (abfd) && info->shared) { /* Create .rtproc section. */ - rtproc_sec = bfd_get_section_by_name (abfd, ".rtproc"); + rtproc_sec = bfd_get_linker_section (abfd, ".rtproc"); if (rtproc_sec == NULL) { flagword flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY); - rtproc_sec = bfd_make_section_with_flags (abfd, - ".rtproc", - flags); + rtproc_sec = bfd_make_section_anyway_with_flags (abfd, + ".rtproc", + flags); if (rtproc_sec == NULL || ! bfd_set_section_alignment (abfd, rtproc_sec, 4)) return FALSE; |