aboutsummaryrefslogtreecommitdiff
path: root/ld/pep-dll.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-04-11 19:37:51 +0930
committerAlan Modra <amodra@gmail.com>2017-04-11 19:49:13 +0930
commitfbea15088db59186960134d11b8bf98070224d6c (patch)
treeb90e6c1a439b2a2441f0075b97198018a60c610e /ld/pep-dll.h
parentb43c520dba2f909c9bbb3ff5f2657c1c9010939b (diff)
downloadgdb-fbea15088db59186960134d11b8bf98070224d6c.zip
gdb-fbea15088db59186960134d11b8bf98070224d6c.tar.gz
gdb-fbea15088db59186960134d11b8bf98070224d6c.tar.bz2
PR 21274, ld segfaults linking PE DLL
Don't use fixed size buffers for symbol names. PR 21274 PR 18466 * emultempl/pe.em (pe_find_data_imports): Don't use fixed size symbol buffer. Instead, xmalloc max size needed with space for prefix. Wrap overlong lines. Formatting. Pass symbol buffer copy of name to pe_walk_relocs_of_symbol. (make_inport_fixup): Add "name" param, pass to pe_create_import_fixup. * emultempl/pe.em (pep_find_data_imports): As for pe_find_data_imports. (make_import_fixup): Add "name" param, pass to pep_create_import_fixup. Use bfd_get_signed_* and remove unnecessary casts. Formatting. * pe-dll.c (pe_walk_relocs_of_symbol): Add "name" param. Pass to callback. (make_import_fixup_mark): Add "name" param. Make use of prefix space rather than xmalloc here. (pe_create_import_fixup): Likewise. * pe-dll.h (pe_walk_relocs_of_symbol): Update prototype. (pe_create_import_fixup): Likewise. * pep-dll.h (pep_walk_relocs_of_symbol): Likewise. (pep_create_import_fixup): Likewise.
Diffstat (limited to 'ld/pep-dll.h')
-rw-r--r--ld/pep-dll.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/ld/pep-dll.h b/ld/pep-dll.h
index 8a4baab..07b4919 100644
--- a/ld/pep-dll.h
+++ b/ld/pep-dll.h
@@ -53,8 +53,9 @@ extern void pep_exe_build_sections (bfd *, struct bfd_link_info *);
extern void pep_dll_fill_sections (bfd *, struct bfd_link_info *);
extern void pep_exe_fill_sections (bfd *, struct bfd_link_info *);
extern void pep_walk_relocs_of_symbol
- (struct bfd_link_info *, const char *, int (*) (arelent *, asection *));
-extern void pep_create_import_fixup (arelent * rel, asection *, bfd_vma);
+ (struct bfd_link_info *, char *, int (*) (arelent *, asection *, char *));
+extern void pep_create_import_fixup (arelent * rel, asection *, bfd_vma,
+ char *);
extern bfd_boolean pep_bfd_is_dll (bfd *);
extern void pep_output_file_set_long_section_names (bfd *);