summaryrefslogtreecommitdiff
path: root/bfd
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
commit969d24233c8d0ae64d221ae235ed1b8cb0aef4a8 (patch)
tree2c85cc5846e20949c214bab33e98b26117f05d47 /bfd
parentb671771eae5d09a7ffc02971e07500d945ebcacf (diff)
downloadgdb-969d24233c8d0ae64d221ae235ed1b8cb0aef4a8.tar.gz
Fix genreation of arm <->thumb glue stubs by ensuring that they are in the last section linked.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/bfd-in.h27
-rw-r--r--bfd/bfd-in2.h27
-rw-r--r--bfd/elf32-arm.h47
4 files changed, 70 insertions, 39 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 169d68a10e5..551fafb064b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2002-05-29 Adam Nemet <anemet@lnxw.com>
+
+ * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue
+ sections only record bfd.
+ (bfd_elf32_arm_add_glue_sections_to_bfd): New function.
+ * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it.
+ * bfd-in2.h: Regenerate.
+
2002-05-28 Nick Clifton <nickc@cambridge.redhat.com>
* syms.c (_bfd_stab_section_find_nearest_line): Move
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 8c36c67bd15..eecd798dcc2 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -4,21 +4,21 @@
Free Software Foundation, Inc.
Contributed by Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__
@@ -803,6 +803,9 @@ extern boolean bfd_elf32_arm_process_before_allocation
extern boolean bfd_elf32_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean bfd_elf32_arm_add_glue_sections_to_bfd
+ PARAMS ((bfd *, struct bfd_link_info *));
+
/* TI COFF load page support. */
extern void bfd_ticoff_set_section_load_page
PARAMS ((struct sec *, int));
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 1dd397a7979..9afd809dd6b 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -10,21 +10,21 @@
Free Software Foundation, Inc.
Contributed by Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__
@@ -809,6 +809,9 @@ extern boolean bfd_elf32_arm_process_before_allocation
extern boolean bfd_elf32_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean bfd_elf32_arm_add_glue_sections_to_bfd
+ PARAMS ((bfd *, struct bfd_link_info *));
+
/* TI COFF load page support. */
extern void bfd_ticoff_set_section_load_page
PARAMS ((struct sec *, int));
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 8b9bf073f16..8285fbdabea 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;
}