aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-05-29 16:03:04 +0000
committerNick Clifton <nickc@redhat.com>2002-05-29 16:03:04 +0000
commit8afb0e028ca79a7b870a0293c8e584529adfbe9f (patch)
tree9e0bf16982ec047849fbf58a1d85b70ea8769bb6 /bfd/elf32-arm.h
parenta95653f53ef6967a458777b5709ed09b76577b47 (diff)
downloadgdb-8afb0e028ca79a7b870a0293c8e584529adfbe9f.zip
gdb-8afb0e028ca79a7b870a0293c8e584529adfbe9f.tar.gz
gdb-8afb0e028ca79a7b870a0293c8e584529adfbe9f.tar.bz2
Fix genreation of arm <->thumb glue stubs by ensuring that they are in the last section linked.
Diffstat (limited to 'bfd/elf32-arm.h')
-rw-r--r--bfd/elf32-arm.h47
1 files changed, 32 insertions, 15 deletions
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 8b9bf07..8285fbd 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -547,31 +547,22 @@ record_thumb_to_arm_glue (link_info, h)
return;
}
-/* Select a BFD to be used to hold the sections used by the glue code.
- This function is called from the linker scripts in ld/emultempl/
- {armelf/pe}.em */
+/* Add the glue sections to ABFD. This function is called from the
+ linker scripts in ld/emultempl/{armelf}.em. */
boolean
-bfd_elf32_arm_get_bfd_for_interworking (abfd, info)
+bfd_elf32_arm_add_glue_sections_to_bfd (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
- struct elf32_arm_link_hash_table *globals;
flagword flags;
asection *sec;
- /* If we are only performing a partial link do not bother
- getting a bfd to hold the glue. */
+ /* If we are only performing a partial
+ link do not bother adding the glue. */
if (info->relocateable)
return true;
- globals = elf32_arm_hash_table (info);
-
- BFD_ASSERT (globals != NULL);
-
- if (globals->bfd_of_glue_owner != NULL)
- return true;
-
sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME);
if (sec == NULL)
@@ -609,9 +600,35 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info)
sec->gc_mark = 1;
}
+ return true;
+}
+
+/* Select a BFD to be used to hold the sections used by the glue code.
+ This function is called from the linker scripts in ld/emultempl/
+ {armelf/pe}.em */
+
+boolean
+bfd_elf32_arm_get_bfd_for_interworking (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ struct elf32_arm_link_hash_table *globals;
+
+ /* If we are only performing a partial link
+ do not bother getting a bfd to hold the glue. */
+ if (info->relocateable)
+ return true;
+
+ globals = elf32_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+
+ if (globals->bfd_of_glue_owner != NULL)
+ return true;
+
/* Save the bfd for later use. */
globals->bfd_of_glue_owner = abfd;
-
+
return true;
}