diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2009-06-17 18:08:35 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2009-06-17 18:08:35 +0000 |
commit | 64e77c6d5fe85b9f3d20579b496f31c329b1e62b (patch) | |
tree | a0315f63d78e86772a2102497a1c47e2872b35b2 /bfd/elflink.c | |
parent | 6bfb4e30b89061e341dad3625360564ab75b1582 (diff) | |
download | gdb-64e77c6d5fe85b9f3d20579b496f31c329b1e62b.zip gdb-64e77c6d5fe85b9f3d20579b496f31c329b1e62b.tar.gz gdb-64e77c6d5fe85b9f3d20579b496f31c329b1e62b.tar.bz2 |
2009-06-17 H.J. Lu <hongjiu.lu@intel.com>
* elf32-arm.c (create_got_section): Get existing .rela.got
section.
* elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise.
* elf32-lm32.c (create_got_section): Likewise.
* elf32-m32r.c (create_got_section): Likewise.
* elf32-ppc.c (ppc_elf_create_got): Likewise.
* elf32-s390.c (create_got_section): Likewise.
* elf32-sh.c (create_got_section): Likewise.
* elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise.
* elf64-s390.c (create_got_section): Likewise.
* elfxx-sparc.c (create_got_section): Likewise.
* elflink.c (_bfd_elf_create_got_section): Properly initialize
the GOT size.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index f1bceae..70bca46 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -110,12 +110,6 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) flags = bed->dynamic_sec_flags; - s = bfd_make_section_with_flags (abfd, ".got", flags); - if (s == NULL - || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) - return FALSE; - htab->sgot = s; - s = bfd_make_section_with_flags (abfd, (bed->rela_plts_and_copies_p ? ".rela.got" : ".rel.got"), @@ -126,6 +120,12 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) return FALSE; htab->srelgot = s; + s = bfd_make_section_with_flags (abfd, ".got", flags); + if (s == NULL + || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + htab->sgot = s; + if (bed->want_got_plt) { s = bfd_make_section_with_flags (abfd, ".got.plt", flags); @@ -136,6 +136,9 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) htab->sgotplt = s; } + /* The first bit of the global offset table is the header. */ + s->size += bed->got_header_size; + if (bed->want_got_sym) { /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got @@ -149,9 +152,6 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) return FALSE; } - /* The first bit of the global offset table is the header. */ - s->size += bed->got_header_size; - return TRUE; } |