diff options
author | Nick Clifton <nickc@redhat.com> | 2004-08-27 07:39:19 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2004-08-27 07:39:19 +0000 |
commit | c034e3e0ec941efa2af0c9715edb6eac8d01fc76 (patch) | |
tree | ece3b7e0d2099f7da12b898831c768b56b242f2f /ld | |
parent | 62e88f3c0c901345638f6e55bbc65a6ff307a132 (diff) | |
download | binutils-gdb-c034e3e0ec941efa2af0c9715edb6eac8d01fc76.tar.gz |
Do not assume that either bfd is an archive
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index a8ec6506a5e..80d662ea761 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2004-08-27 Nick Clifton <nickc@redhat.com> + + * emultempl/pe.em (after_open): Do not assume that either bfd is + an archive. + 2004-08-26 Alan Modra <amodra@bigpond.net.au> * ldlang.c (lang_init): Don't compare with TRUE. diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 7c5b2d0d1ab..09916911015 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -1096,17 +1096,19 @@ gld_${EMULATION_NAME}_after_open (void) continue; other_bfd = blhe->u.def.section->owner; +#define bfd_filename(bfd) ((bfd)->my_archive ? bfd_get_filename ((bfd)->my_archive) : bfd_get_filename (bfd)) - if (strcmp (is->the_bfd->my_archive->filename, - other_bfd->my_archive->filename) == 0) + if (strcmp (bfd_filename (is->the_bfd), + bfd_filename (other_bfd)) == 0) continue; - /* Rename this implib to match the other. */ - n = (char *) xmalloc (strlen (other_bfd->my_archive->filename) + 1); + /* Rename this implib to match the other one. */ + n = xmalloc (strlen (bfd_filename (other_bfd)) + 1); - strcpy (n, other_bfd->my_archive->filename); + strcpy (n, bfd_filename (other_bfd)); - is->the_bfd->my_archive->filename = n; + bfd_filename (is->the_bfd) = n; +#undef bfd_filename } free (relocs); |