default: tls_type = GOT_NORMAL; break;
}
- if (sgot == NULL)
- {
- sgot = htab->root.sgot;
- BFD_ASSERT (sgot != NULL);
- }
-
- if (srelgot == NULL
- && (h != NULL || bfd_link_pic (info)))
- {
- srelgot = bfd_get_linker_section (dynobj, ".rela.got");
- if (srelgot == NULL)
- {
- flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY | SEC_LINKER_CREATED
- | SEC_READONLY);
- srelgot = bfd_make_section_anyway_with_flags (dynobj,
- ".rela.got",
- flags);
- if (srelgot == NULL
- || ! bfd_set_section_alignment (dynobj, srelgot, 2))
- goto fail;
- }
- }
+ sgot = htab->root.sgot;
+ srelgot = htab->root.srelgot;
+ BFD_ASSERT (sgot != NULL && srelgot != NULL);
if (r_type == R_MN10300_TLS_LD)
{
if (!htab->tls_ldm_got.rel_emitted)
{
- asection * srelgot = bfd_get_linker_section (dynobj, ".rela.got");
+ asection *srelgot = htab->root.srelgot;
Elf_Internal_Rela rel;
BFD_ASSERT (srelgot != NULL);
if (bfd_link_pic (info))
{
- asection * srelgot;
+ asection *srelgot = htab->root.srelgot;;
Elf_Internal_Rela outrel;
- srelgot = bfd_get_linker_section (dynobj, ".rela.got");
BFD_ASSERT (srelgot != NULL);
outrel.r_offset = (sgot->output_section->vma
s->size += 4;
/* We also need to make an entry in the .rela.plt section. */
- s = bfd_get_linker_section (dynobj, ".rela.plt");
+ s = htab->root.srelplt;
BFD_ASSERT (s != NULL);
s->size += sizeof (Elf32_External_Rela);
if (htab->tls_ldm_got.refcount > 0)
{
- s = bfd_get_linker_section (dynobj, ".rela.got");
+ s = htab->root.srelgot;
BFD_ASSERT (s != NULL);
s->size += sizeof (Elf32_External_Rela);
}
splt = htab->root.splt;
sgot = htab->root.sgotplt;
- srel = bfd_get_linker_section (dynobj, ".rela.plt");
+ srel = htab->root.srelplt;
BFD_ASSERT (splt != NULL && sgot != NULL && srel != NULL);
/* Get the index in the procedure linkage table which
/* This symbol has an entry in the global offset table. Set it up. */
sgot = htab->root.sgot;
- srel = bfd_get_linker_section (dynobj, ".rela.got");
+ srel = htab->root.srelgot;
BFD_ASSERT (sgot != NULL && srel != NULL);
rel.r_offset = (sgot->output_section->vma
for (; dyncon < dynconend; dyncon++)
{
Elf_Internal_Dyn dyn;
- const char * name;
asection * s;
bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
break;
case DT_PLTGOT:
- name = ".got";
+ s = htab->root.sgot;
goto get_vma;
case DT_JMPREL:
- name = ".rela.plt";
+ s = htab->root.srelplt;
get_vma:
- s = bfd_get_linker_section (dynobj, name);
dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_PLTRELSZ:
- s = bfd_get_linker_section (dynobj, ".rela.plt");
+ s = htab->root.srelplt;
dyn.d_un.d_val = s->size;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
the linker script arranges for .rela.plt to follow all
other relocation sections, we don't have to worry
about changing the DT_RELA entry. */
- s = bfd_get_linker_section (dynobj, ".rela.plt");
+ s = htab->root.srelplt;
if (s != NULL)
dyn.d_un.d_val -= s->size;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);