aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-10-19 02:10:41 +0000
committerAlan Modra <amodra@gmail.com>2006-10-19 02:10:41 +0000
commit2f4754876fee13c0bed40782e439e1a589f5caae (patch)
tree2936eaa9342587896fd32583e3da6c70d8d5acbf /bfd/elf32-arm.c
parent0532541186c1b120fc0b4c4993c097fc3d136823 (diff)
downloadgdb-2f4754876fee13c0bed40782e439e1a589f5caae.zip
gdb-2f4754876fee13c0bed40782e439e1a589f5caae.tar.gz
gdb-2f4754876fee13c0bed40782e439e1a589f5caae.tar.bz2
bfd/
* elf32-arm.c (bfd_elf32_arm_allocate_interworking_sect): Check, don't set, glue section size. (record_arm_to_thumb_glue): Set glue section size here. (record_thumb_to_arm_glue): Likewise. (bfd_elf32_arm_add_glue_sections_to_bfd): Formatting. (bfd_elf32_arm_process_before_allocation): Ignore exluded sections. ld/ * emultempl/armelf.em (arm_elf_before_allocation): Run gld${EMULATION_NAME}_before_allocation later. * ldlang.c (lang_size_sections_1): Revert 2006-09-15 change.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index f9f668f..06adaef 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2565,7 +2565,7 @@ bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info * info)
foo = bfd_alloc (globals->bfd_of_glue_owner, globals->arm_glue_size);
- s->size = globals->arm_glue_size;
+ BFD_ASSERT (s->size == globals->arm_glue_size);
s->contents = foo;
}
@@ -2580,7 +2580,7 @@ bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info * info)
foo = bfd_alloc (globals->bfd_of_glue_owner, globals->thumb_glue_size);
- s->size = globals->thumb_glue_size;
+ BFD_ASSERT (s->size == globals->thumb_glue_size);
s->contents = foo;
}
@@ -2600,6 +2600,7 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info,
struct bfd_link_hash_entry * bh;
struct elf32_arm_link_hash_table * globals;
bfd_vma val;
+ bfd_size_type size;
globals = elf32_arm_hash_table (link_info);
@@ -2643,9 +2644,12 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info,
free (tmp_name);
if ((link_info->shared || globals->root.is_relocatable_executable))
- globals->arm_glue_size += ARM2THUMB_PIC_GLUE_SIZE;
+ size = ARM2THUMB_PIC_GLUE_SIZE;
else
- globals->arm_glue_size += ARM2THUMB_STATIC_GLUE_SIZE;
+ size = ARM2THUMB_STATIC_GLUE_SIZE;
+
+ s->size += size;
+ globals->arm_glue_size += size;
return myh;
}
@@ -2721,6 +2725,7 @@ record_thumb_to_arm_glue (struct bfd_link_info *link_info,
free (tmp_name);
+ s->size += THUMB2ARM_GLUE_SIZE;
hash_table->thumb_glue_size += THUMB2ARM_GLUE_SIZE;
return;
@@ -2748,7 +2753,8 @@ bfd_elf32_arm_add_glue_sections_to_bfd (bfd *abfd,
/* Note: we do not include the flag SEC_LINKER_CREATED, as this
will prevent elf_link_input_bfd() from processing the contents
of this section. */
- flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+ | SEC_CODE | SEC_READONLY);
sec = bfd_make_section_with_flags (abfd,
ARM2THUMB_GLUE_SECTION_NAME,
@@ -2767,8 +2773,8 @@ bfd_elf32_arm_add_glue_sections_to_bfd (bfd *abfd,
if (sec == NULL)
{
- flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
- | SEC_CODE | SEC_READONLY;
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+ | SEC_CODE | SEC_READONLY);
sec = bfd_make_section_with_flags (abfd,
THUMB2ARM_GLUE_SECTION_NAME,
@@ -2865,6 +2871,9 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd,
if (sec->reloc_count == 0)
continue;
+ if ((sec->flags & SEC_EXCLUDE) != 0)
+ continue;
+
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Load the relocs. */