summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-08-17 03:12:49 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-08-17 03:12:49 +0000
commitf495880d3c170fcfc49a14481a9147d7f865cacb (patch)
treeed5aaf68610a3122c6532fb91bbcdb36038b9514
parent59257b4df4c483b4c005cace2667d5893c31c98a (diff)
downloadgdb-f495880d3c170fcfc49a14481a9147d7f865cacb.tar.gz
bfd/
* bfd.c (struct _bfd): Correct outsymbols comment. * bfd-in2.h: Regenerate. * linker.c (bfd_generic_link_read_symbols): Renamed from.. (generic_link_read_symbols): ..this, and made global. include/ * bfdlink.h (bfd_generic_link_read_symbols): Declare. ld/ PR 6478 * ldcref.c (check_local_sym_xref): Use bfd_generic_link_read_symbols. Don't free symbol pointer array. (check_refs): Likewise. * ldmain.c (warning_callback): Likewise. * ldmisc.c (vfinfo): Likewise. * pe-dll.c (process_def_file): Likewise. (pe_walk_relocs_of_symbol, generate_reloc): Likewise. * emultempl/pe.em (pe_find_data_imports): Likewise. (gld_${EMULATION_NAME}_after_open): Likewise. * emultempl/pep.em (pep_find_data_imports): Likewise. (gld_${EMULATION_NAME}_after_open): Likewise. * ldlang.h (lang_input_statement_type): Delete asymbols, symbol_count, passive_position, closed. * ldlang.c (new_afile): Don't set asymbols and symbol_count. * ldmain.c (add_archive_element): xcalloc lang_input_statement_type.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/bfd-in2.h3
-rw-r--r--bfd/bfd.c3
-rw-r--r--bfd/linker.c12
-rw-r--r--include/ChangeLog4
-rw-r--r--include/bfdlink.h3
6 files changed, 24 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a4d9667ba97..a85352579fd 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-17 Alan Modra <amodra@bigpond.net.au>
+
+ * bfd.c (struct _bfd): Correct outsymbols comment.
+ * bfd-in2.h: Regenerate.
+ * linker.c (bfd_generic_link_read_symbols): Renamed from..
+ (generic_link_read_symbols): ..this, and made global.
+
2008-08-15 Alan Modra <amodra@bigpond.net.au>
PR 6526
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 8868e7d2642..a39c46162f3 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -4712,7 +4712,8 @@ struct bfd
/* Used for input and output. */
unsigned int symcount;
- /* Symbol table for output BFD (with symcount entries). */
+ /* Symbol table for output BFD (with symcount entries).
+ Also used by the linker to cache input BFD symbols. */
struct bfd_symbol **outsymbols;
/* Used for slurped dynamic symbol tables. */
diff --git a/bfd/bfd.c b/bfd/bfd.c
index ed89e664cc7..1ffd7d05b1d 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -176,7 +176,8 @@ CODE_FRAGMENT
. {* Used for input and output. *}
. unsigned int symcount;
.
-. {* Symbol table for output BFD (with symcount entries). *}
+. {* Symbol table for output BFD (with symcount entries).
+. Also used by the linker to cache input BFD symbols. *}
. struct bfd_symbol **outsymbols;
.
. {* Used for slurped dynamic symbol tables. *}
diff --git a/bfd/linker.c b/bfd/linker.c
index 327426e3c51..baf280c7a24 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -737,8 +737,8 @@ _bfd_generic_link_hash_table_free (struct bfd_link_hash_table *hash)
the hash table pointing to different instances of the symbol
structure. */
-static bfd_boolean
-generic_link_read_symbols (bfd *abfd)
+bfd_boolean
+bfd_generic_link_read_symbols (bfd *abfd)
{
if (bfd_get_outsymbols (abfd) == NULL)
{
@@ -834,7 +834,7 @@ generic_link_add_object_symbols (bfd *abfd,
bfd_size_type symcount;
struct bfd_symbol **outsyms;
- if (! generic_link_read_symbols (abfd))
+ if (!bfd_generic_link_read_symbols (abfd))
return FALSE;
symcount = _bfd_generic_link_get_symcount (abfd);
outsyms = _bfd_generic_link_get_symbols (abfd);
@@ -1164,7 +1164,7 @@ generic_link_check_archive_element (bfd *abfd,
*pneeded = FALSE;
- if (! generic_link_read_symbols (abfd))
+ if (!bfd_generic_link_read_symbols (abfd))
return FALSE;
pp = _bfd_generic_link_get_symbols (abfd);
@@ -2159,7 +2159,7 @@ _bfd_generic_link_output_symbols (bfd *output_bfd,
asymbol **sym_ptr;
asymbol **sym_end;
- if (! generic_link_read_symbols (input_bfd))
+ if (!bfd_generic_link_read_symbols (input_bfd))
return FALSE;
/* Create a filename symbol if we are supposed to. */
@@ -2752,7 +2752,7 @@ default_indirect_link_order (bfd *output_bfd,
have retrieved them by this point, but we are being called by
a specific linker, presumably because we are linking
different types of object files together. */
- if (! generic_link_read_symbols (input_bfd))
+ if (!bfd_generic_link_read_symbols (input_bfd))
return FALSE;
/* Since we have been called by a specific linker, rather than
diff --git a/include/ChangeLog b/include/ChangeLog
index a1e31a64db0..c86f60089a9 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-17 Alan Modra <amodra@bigpond.net.au>
+
+ * bfdlink.h (bfd_generic_link_read_symbols): Declare.
+
2008-08-08 Anatoly Sokolov <aesok@post.ru>
* elf/avr.h (E_AVR_MACH_AVR25, E_AVR_MACH_AVR31,
diff --git a/include/bfdlink.h b/include/bfdlink.h
index e6833102839..d27b5388d3b 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -198,6 +198,9 @@ extern void bfd_link_add_undef
extern void bfd_link_repair_undef_list
(struct bfd_link_hash_table *table);
+/* Read symbols and cache symbol pointer array in outsymbols. */
+extern bfd_boolean bfd_generic_link_read_symbols (bfd *);
+
struct bfd_sym_chain
{
struct bfd_sym_chain *next;