diff options
author | Alan Modra <amodra@gmail.com> | 2005-04-12 12:22:11 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-04-12 12:22:11 +0000 |
commit | 959c0beba7a19da1fbc5cb643c6550cfaa56000a (patch) | |
tree | 8ca225e90647aa2fc780fb2c03eec8cf4be4ff25 /ld | |
parent | bb8e510354c18191ebf0f048bae3314156b4a1f6 (diff) | |
download | gdb-959c0beba7a19da1fbc5cb643c6550cfaa56000a.zip gdb-959c0beba7a19da1fbc5cb643c6550cfaa56000a.tar.gz gdb-959c0beba7a19da1fbc5cb643c6550cfaa56000a.tar.bz2 |
* emultempl/elf32.em (gld${EMULATION_NAME}_stat_needed): Ignore
as_needed libs that were not needed.
(gld${EMULATION_NAME}_check_needed): Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/emultempl/elf32.em | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 8e3f5cb..5d22314 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2005-04-12 Alan Modra <amodra@bigpond.net.au> + + * emultempl/elf32.em (gld${EMULATION_NAME}_stat_needed): Ignore + as_needed libs that were not needed. + (gld${EMULATION_NAME}_check_needed): Likewise. + 2005-03-24 Nick Clifton <nickc@redhat.com> * po/fr.po: Updated French translation. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 8bdf88d..a5e6739 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -226,6 +226,9 @@ gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s) return; if (s->the_bfd == NULL) return; + if (s->as_needed + && (bfd_elf_get_dyn_lib_class (s->the_bfd) & DYN_AS_NEEDED) != 0) + return; if (bfd_stat (s->the_bfd, &st) != 0) { @@ -733,6 +736,13 @@ gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s) if (global_found) return; + /* If this input file was an as-needed entry, and wasn't found to be + needed at the stage it was linked, then don't say we have loaded it. */ + if (s->as_needed + && (s->the_bfd == NULL + || (bfd_elf_get_dyn_lib_class (s->the_bfd) & DYN_AS_NEEDED) != 0)) + return; + if (s->filename != NULL) { const char *f; |