aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-05-29 05:00:01 +0000
committerAlan Modra <amodra@gmail.com>2002-05-29 05:00:01 +0000
commit7cdc5bba784e1ba9458482fd8315930a5f78125e (patch)
treee65ecb5d85f7584830e0cfb6845673f60b191c8d
parent241264c6a6f8b877e6ccd265d871432edfc3ddfa (diff)
downloadgdb-7cdc5bba784e1ba9458482fd8315930a5f78125e.zip
gdb-7cdc5bba784e1ba9458482fd8315930a5f78125e.tar.gz
gdb-7cdc5bba784e1ba9458482fd8315930a5f78125e.tar.bz2
* elf64-ppc.c (ppc64_elf_get_symbol_info): New function.
(bfd_elf64_get_symbol_info): Define. * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf64-ppc.c19
-rw-r--r--bfd/elfxx-target.h2
3 files changed, 27 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b96730b..0db8544 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-29 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_get_symbol_info): New function.
+ (bfd_elf64_get_symbol_info): Define.
+ * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef.
+
2002-05-29 Andrey Volkov <avolkov@transas.com>
* cpu-h8300.c: Make default h8300 machine first in machine list.
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index b703ab6..ff956a5 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -55,6 +55,8 @@ static bfd_reloc_status_type ppc64_elf_toc64_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type ppc64_elf_unhandled_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static void ppc64_elf_get_symbol_info
+ PARAMS ((bfd *, asymbol *, symbol_info *));
static boolean ppc64_elf_set_private_flags
PARAMS ((bfd *, flagword));
static boolean ppc64_elf_merge_private_bfd_data
@@ -1631,6 +1633,22 @@ ppc64_elf_unhandled_reloc (abfd, reloc_entry, symbol, data,
return bfd_reloc_dangerous;
}
+/* Return symbol info as per usual for ELF targets, except that
+ symbols in .opd are given 'd' or 'D' for type. */
+
+static void
+ppc64_elf_get_symbol_info (abfd, symbol, ret)
+ bfd *abfd;
+ asymbol *symbol;
+ symbol_info *ret;
+{
+ _bfd_elf_get_symbol_info (abfd, symbol, ret);
+ if (ret->type == '?'
+ && (symbol->flags & (BSF_GLOBAL | BSF_LOCAL)) != 0
+ && strcmp (symbol->section->name, ".opd") == 0)
+ ret->type = (symbol->flags & BSF_GLOBAL) != 0 ? 'D' : 'd';
+}
+
/* Function to set whether a module needs the -mrelocatable bit set. */
static boolean
@@ -6108,6 +6126,7 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info)
#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data
#define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create
#define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free
+#define bfd_elf64_get_symbol_info ppc64_elf_get_symbol_info
#define elf_backend_section_from_shdr ppc64_elf_section_from_shdr
#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 08b680a..fbcd0a7 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -44,7 +44,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef bfd_elfNN_get_reloc_upper_bound
#define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound
#endif
+#ifndef bfd_elfNN_get_symbol_info
#define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info
+#endif
#define bfd_elfNN_get_symtab _bfd_elf_get_symtab
#define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound
#if 0 /* done in elf-bfd.h */