aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2004-04-27 16:06:07 +0000
committerH.J. Lu <hjl.tools@gmail.com>2004-04-27 16:06:07 +0000
commitbeb8df56a1b4c58ed3d79b3cec93c15f91290147 (patch)
treeaeede7add9927fd4f3cd3c49a44cbfbf8147c603 /bfd
parenta95b5cf9a6ef8493d5f133677692e29b5194420a (diff)
downloadgdb-beb8df56a1b4c58ed3d79b3cec93c15f91290147.zip
gdb-beb8df56a1b4c58ed3d79b3cec93c15f91290147.tar.gz
gdb-beb8df56a1b4c58ed3d79b3cec93c15f91290147.tar.bz2
2004-04-27 H.J. Lu <hongjiu.lu@intel.com>
* elf32-sh64.c (elf_backend_section_flags): New. Defined. (sh64_elf_set_mach_from_flags): Remove the kludge for .cranges section. (sh64_elf_section_flags): New. Set SEC_DEBUGGING for .cranges section.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elf32-sh64.c23
2 files changed, 20 insertions, 11 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cb505e4..18d734f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2004-04-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-sh64.c (elf_backend_section_flags): New. Defined.
+ (sh64_elf_set_mach_from_flags): Remove the kludge for .cranges
+ section.
+ (sh64_elf_section_flags): New. Set SEC_DEBUGGING for .cranges
+ section.
+
2004-04-27 Alan Modra <amodra@bigpond.net.au>
* elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index f013e6f..62cf2e6 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -89,6 +89,7 @@ static void sh64_find_section_for_address
#define elf_backend_final_write_processing sh64_elf_final_write_processing
#define elf_backend_section_from_shdr sh64_backend_section_from_shdr
#define elf_backend_special_sections sh64_elf_special_sections
+#define elf_backend_section_flags sh64_elf_section_flags
#define bfd_elf32_new_section_hook sh64_elf_new_section_hook
@@ -149,7 +150,6 @@ static bfd_boolean
sh64_elf_set_mach_from_flags (bfd *abfd)
{
flagword flags = elf_elfheader (abfd)->e_flags;
- asection *cranges;
switch (flags & EF_SH_MACH_MASK)
{
@@ -164,18 +164,19 @@ sh64_elf_set_mach_from_flags (bfd *abfd)
return FALSE;
}
- /* We also need to set SEC_DEBUGGING on an incoming .cranges section.
- We could have used elf_backend_section_flags if it had given us the
- section name; the bfd_section member in the header argument is not
- set at the point of the call. FIXME: Find out whether that is by
- undocumented design or a bug. */
- cranges = bfd_get_section_by_name (abfd, SH64_CRANGES_SECTION_NAME);
- if (cranges != NULL
- && ! bfd_set_section_flags (abfd, cranges,
- bfd_get_section_flags (abfd, cranges)
- | SEC_DEBUGGING))
+ return TRUE;
+}
+
+static bfd_boolean
+sh64_elf_section_flags (flagword *flags,
+ const Elf_Internal_Shdr *hdr)
+{
+ if (hdr->bfd_section == NULL)
return FALSE;
+ if (strcmp (hdr->bfd_section->name, SH64_CRANGES_SECTION_NAME) == 0)
+ *flags |= SEC_DEBUGGING;
+
return TRUE;
}