diff options
author | DJ Delorie <dj@redhat.com> | 1998-11-10 03:45:43 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 1998-11-10 03:45:43 +0000 |
commit | 91c7ad9a6ad43c73e582f039e12c8787bf09279e (patch) | |
tree | fd871eea0916320166bbc442fdc1c19a70646364 /ld | |
parent | 8bf844741a859d0a7b2a20bbcaacb8a9e3bdce30 (diff) | |
download | gdb-91c7ad9a6ad43c73e582f039e12c8787bf09279e.zip gdb-91c7ad9a6ad43c73e582f039e12c8787bf09279e.tar.gz gdb-91c7ad9a6ad43c73e582f039e12c8787bf09279e.tar.bz2 |
* pe-dll.c (process_def_file): don't assume exports won't move
during a realloc
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/pe-dll.c | 18 |
2 files changed, 15 insertions, 8 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 10805fc..ea7dd5a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +Mon Nov 9 22:44:58 1998 DJ Delorie <dj@cygnus.com> + + * pe-dll.c (process_def_file): don't assume exports won't move + during a realloc + Mon Nov 9 16:41:30 1998 DJ Delorie <dj@cygnus.com> * pe-dll.c: New file; direct support for PE DLLs diff --git a/ld/pe-dll.c b/ld/pe-dll.c index abfd9d4..72444c0 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -182,7 +182,7 @@ process_def_file (abfd, info) struct bfd_link_hash_entry *blhe; bfd *b; struct sec *s; - def_file_export *e; + def_file_export *e=0; if (!pe_def_file) pe_def_file = def_file_empty (); @@ -233,7 +233,6 @@ process_def_file (abfd, info) #undef NE #define NE pe_def_file->num_exports - e = pe_def_file->exports; /* convenience */ /* Canonicalize the export list */ @@ -241,13 +240,13 @@ process_def_file (abfd, info) { for (i = 0; i < NE; i++) { - if (strchr (e[i].name, '@')) + if (strchr (pe_def_file->exports[i].name, '@')) { /* This will preserve internal_name, which may have been pointing to the same memory as name, or might not have */ - char *tmp = xstrdup (e[i].name); + char *tmp = xstrdup (pe_def_file->exports[i].name); *(strchr (tmp, '@')) = 0; - e[i].name = tmp; + pe_def_file->exports[i].name = tmp; } } } @@ -256,18 +255,21 @@ process_def_file (abfd, info) { for (i = 0; i < NE; i++) { - if (strchr (e[i].name, '@')) + if (strchr (pe_def_file->exports[i].name, '@')) { - char *tmp = xstrdup (e[i].name); + char *tmp = xstrdup (pe_def_file->exports[i].name); *(strchr (tmp, '@')) = 0; if (auto_export (pe_def_file, tmp)) - def_file_add_export (pe_def_file, tmp, e[i].internal_name, -1); + def_file_add_export (pe_def_file, tmp, + pe_def_file->exports[i].internal_name, -1); else free (tmp); } } } + e = pe_def_file->exports; /* convenience */ + exported_symbol_offsets = (bfd_vma *) xmalloc (NE * sizeof (bfd_vma)); exported_symbol_sections = (struct sec **) xmalloc (NE * sizeof (struct sec *)); |