summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1999-08-11 09:30:20 +0000
committerJeff Law <law@redhat.com>1999-08-11 09:30:20 +0000
commit83bc4508779a54ad4f92b1d60835092350762cab (patch)
tree77002b1af63b8447727c50684cdc6640a935f76b
parent90be903e6cef8f4263b580d590670f918ddf4aaa (diff)
downloadgdb-83bc4508779a54ad4f92b1d60835092350762cab.tar.gz
* elf-hppa.h (elf_hppa_fake_sections): New function.
* elf32-hppa.c (elf_backend_fake_sections): Define.
-rw-r--r--bfd/ChangeLog3
-rw-r--r--bfd/elf-hppa.h30
-rw-r--r--bfd/elf32-hppa.c2
3 files changed, 35 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e75a82d24e3..645b1187417 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,8 @@
Tue Aug 10 12:48:09 1999 Jeffrey A Law (law@cygnus.com)
+ * elf-hppa.h (elf_hppa_fake_sections): New function.
+ * elf32-hppa.c (elf_backend_fake_sections): Define.
+
* elf-hppa.h (elf_hppa_final_write_processing): Update for
recent changes to the arch_info structure.
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index b046844cbcd..67bc319c2cc 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -621,3 +621,33 @@ elf_hppa_is_local_label_name (abfd, name)
return (name[0] == 'L' && name[1] == '$');
}
+/* Set the correct type for an ELF section. We do this by the
+ section name, which is a hack, but ought to work. */
+
+static boolean
+elf_hppa_fake_sections (abfd, hdr, sec)
+ bfd *abfd;
+ Elf64_Internal_Shdr *hdr;
+ asection *sec;
+{
+ register const char *name;
+
+ name = bfd_get_section_name (abfd, sec);
+
+ if (strcmp (name, ".PARISC.unwind") == 0)
+ {
+ section *sec;
+ hdr->sh_type = SHT_LOPROC + 1;
+ /* ?!? How are unwinds supposed to work for symbols in arbitrary
+ sections? Or what if we have multiple .text sections in a single
+ .o file? HP really messed up on this one. */
+ sec = bfd_get_section_by_name (abfd, ".text");
+ if (sec != NULL)
+ hdr->sh_info = elf_section_data (sec)->this_idx;
+
+ /* I have no idea if this is really necessary or what it means. */
+ hdr->sh_entsize = 4;
+ }
+ return true;
+}
+
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 5f4935e883b..cc955349b31 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -1317,6 +1317,8 @@ error_return:
#define elf_backend_add_symbol_hook elf32_hppa_add_symbol_hook
#define bfd_elf32_bfd_link_hash_table_create \
elf32_hppa_link_hash_table_create
+#define elf_backend_fake_sections elf_hppa_fake_sections
+
#define TARGET_BIG_SYM bfd_elf32_hppa_vec
#define TARGET_BIG_NAME "elf32-hppa"