summaryrefslogtreecommitdiffstats
path: root/bfd/elflink.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index f1bceaed6b..70bca46953 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;
}
OpenPOWER on IntegriCloud