summaryrefslogtreecommitdiff
path: root/bfd/elf32-m68k.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r--bfd/elf32-m68k.c77
1 files changed, 34 insertions, 43 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 39832be83cf..842f38cd725 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -513,9 +513,9 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
}
/* Allocate space in the .got section. */
- sgot->_raw_size += 4;
+ sgot->size += 4;
/* Allocate relocation space. */
- srelgot->_raw_size += sizeof (Elf32_External_Rela);
+ srelgot->size += sizeof (Elf32_External_Rela);
}
h->got.refcount++;
}
@@ -536,13 +536,13 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
}
if (local_got_refcounts[r_symndx] == 0)
{
- sgot->_raw_size += 4;
+ sgot->size += 4;
if (info->shared)
{
/* If we are generating a shared object, we need to
output a R_68K_RELATIVE reloc so that the dynamic
linker can adjust this GOT entry. */
- srelgot->_raw_size += sizeof (Elf32_External_Rela);
+ srelgot->size += sizeof (Elf32_External_Rela);
}
}
local_got_refcounts[r_symndx]++;
@@ -684,7 +684,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
|| ELF32_R_TYPE (rel->r_info) == R_68K_PC32))
info->flags |= DF_TEXTREL;
- sreloc->_raw_size += sizeof (Elf32_External_Rela);
+ sreloc->size += sizeof (Elf32_External_Rela);
/* We count the number of PC relative relocations we have
entered for this symbol, so that we can discard them
@@ -856,8 +856,8 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs)
if (h->got.refcount == 0)
{
/* We don't need the .got entry any more. */
- sgot->_raw_size -= 4;
- srelgot->_raw_size -= sizeof (Elf32_External_Rela);
+ sgot->size -= 4;
+ srelgot->size -= sizeof (Elf32_External_Rela);
}
}
}
@@ -869,9 +869,9 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs)
if (local_got_refcounts[r_symndx] == 0)
{
/* We don't need the .got entry any more. */
- sgot->_raw_size -= 4;
+ sgot->size -= 4;
if (info->shared)
- srelgot->_raw_size -= sizeof (Elf32_External_Rela);
+ srelgot->size -= sizeof (Elf32_External_Rela);
}
}
}
@@ -979,12 +979,12 @@ elf_m68k_adjust_dynamic_symbol (info, h)
/* If this is the first .plt entry, make room for the special
first entry. */
- if (s->_raw_size == 0)
+ if (s->size == 0)
{
if (CPU32_FLAG (dynobj))
- s->_raw_size += PLT_CPU32_ENTRY_SIZE;
+ s->size += PLT_CPU32_ENTRY_SIZE;
else
- s->_raw_size += PLT_ENTRY_SIZE;
+ s->size += PLT_ENTRY_SIZE;
}
/* If this symbol is not defined in a regular file, and we are
@@ -996,27 +996,27 @@ elf_m68k_adjust_dynamic_symbol (info, h)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{
h->root.u.def.section = s;
- h->root.u.def.value = s->_raw_size;
+ h->root.u.def.value = s->size;
}
- h->plt.offset = s->_raw_size;
+ h->plt.offset = s->size;
/* Make room for this entry. */
if (CPU32_FLAG (dynobj))
- s->_raw_size += PLT_CPU32_ENTRY_SIZE;
+ s->size += PLT_CPU32_ENTRY_SIZE;
else
- s->_raw_size += PLT_ENTRY_SIZE;
+ s->size += PLT_ENTRY_SIZE;
/* We also need to make an entry in the .got.plt section, which
will be placed in the .got section by the linker script. */
s = bfd_get_section_by_name (dynobj, ".got.plt");
BFD_ASSERT (s != NULL);
- s->_raw_size += 4;
+ s->size += 4;
/* We also need to make an entry in the .rela.plt section. */
s = bfd_get_section_by_name (dynobj, ".rela.plt");
BFD_ASSERT (s != NULL);
- s->_raw_size += sizeof (Elf32_External_Rela);
+ s->size += sizeof (Elf32_External_Rela);
return TRUE;
}
@@ -1070,7 +1070,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
srel = bfd_get_section_by_name (dynobj, ".rela.bss");
BFD_ASSERT (srel != NULL);
- srel->_raw_size += sizeof (Elf32_External_Rela);
+ srel->size += sizeof (Elf32_External_Rela);
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
}
@@ -1081,8 +1081,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
power_of_two = 3;
/* Apply the required alignment. */
- s->_raw_size = BFD_ALIGN (s->_raw_size,
- (bfd_size_type) (1 << power_of_two));
+ s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
if (power_of_two > bfd_get_section_alignment (dynobj, s))
{
if (!bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -1091,10 +1090,10 @@ elf_m68k_adjust_dynamic_symbol (info, h)
/* Define the symbol as being at this point in the section. */
h->root.u.def.section = s;
- h->root.u.def.value = s->_raw_size;
+ h->root.u.def.value = s->size;
/* Increment the section size to make room for the symbol. */
- s->_raw_size += h->size;
+ s->size += h->size;
return TRUE;
}
@@ -1121,7 +1120,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
{
s = bfd_get_section_by_name (dynobj, ".interp");
BFD_ASSERT (s != NULL);
- s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->size = sizeof ELF_DYNAMIC_INTERPRETER;
s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
}
}
@@ -1134,7 +1133,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
below. */
s = bfd_get_section_by_name (dynobj, ".rela.got");
if (s != NULL)
- s->_raw_size = 0;
+ s->size = 0;
}
/* If this is a -Bsymbolic shared link, then we need to discard all
@@ -1169,7 +1168,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
if (strcmp (name, ".plt") == 0)
{
- if (s->_raw_size == 0)
+ if (s->size == 0)
{
/* Strip this section if we don't need it; see the
comment below. */
@@ -1183,7 +1182,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
}
else if (strncmp (name, ".rela", 5) == 0)
{
- if (s->_raw_size == 0)
+ if (s->size == 0)
{
/* If we don't need this section, strip it from the
output file. This is mostly to handle .rela.bss and
@@ -1223,8 +1222,8 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
are written out, but at the moment this does not happen. Thus in
order to prevent writing out garbage, we initialise the section's
contents to zero. */
- s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
- if (s->contents == NULL && s->_raw_size != 0)
+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+ if (s->contents == NULL && s->size != 0)
return FALSE;
}
@@ -1319,7 +1318,7 @@ elf_m68k_discard_copies (h, inf)
for (s = elf_m68k_hash_entry (h)->pcrel_relocs_copied;
s != NULL;
s = s->next)
- s->section->_raw_size -= s->count * sizeof (Elf32_External_Rela);
+ s->section->size -= s->count * sizeof (Elf32_External_Rela);
return TRUE;
}
@@ -1970,7 +1969,7 @@ elf_m68k_finish_dynamic_sections (output_bfd, info)
BFD_ASSERT (splt != NULL && sdyn != NULL);
dyncon = (Elf32_External_Dyn *) sdyn->contents;
- dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+ dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
for (; dyncon < dynconend; dyncon++)
{
Elf_Internal_Dyn dyn;
@@ -1999,10 +1998,7 @@ elf_m68k_finish_dynamic_sections (output_bfd, info)
case DT_PLTRELSZ:
s = bfd_get_section_by_name (output_bfd, ".rela.plt");
BFD_ASSERT (s != NULL);
- if (s->_cooked_size != 0)
- dyn.d_un.d_val = s->_cooked_size;
- else
- dyn.d_un.d_val = s->_raw_size;
+ dyn.d_un.d_val = s->size;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
@@ -2016,19 +2012,14 @@ elf_m68k_finish_dynamic_sections (output_bfd, info)
about changing the DT_RELA entry. */
s = bfd_get_section_by_name (output_bfd, ".rela.plt");
if (s != NULL)
- {
- if (s->_cooked_size != 0)
- dyn.d_un.d_val -= s->_cooked_size;
- else
- dyn.d_un.d_val -= s->_raw_size;
- }
+ dyn.d_un.d_val -= s->size;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
}
}
/* Fill in the first entry in the procedure linkage table. */
- if (splt->_raw_size > 0)
+ if (splt->size > 0)
{
if (!CPU32_FLAG (output_bfd))
{
@@ -2066,7 +2057,7 @@ elf_m68k_finish_dynamic_sections (output_bfd, info)
}
/* Fill in the first three entries in the global offset table. */
- if (sgot->_raw_size > 0)
+ if (sgot->size > 0)
{
if (sdyn == NULL)
bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);