diff options
author | Mark Harmstone <mark@harmstone.com> | 2022-10-17 00:24:19 +0100 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-10-20 15:22:37 +1030 |
commit | b41a65333fc89edb418d22164c275212e32b036d (patch) | |
tree | be6144ed139d96e08618f1750cedc6aaaa6edbe9 /ld/emultempl | |
parent | f6f30f347bb97898a74e59a841982170e42bb265 (diff) | |
download | gdb-b41a65333fc89edb418d22164c275212e32b036d.zip gdb-b41a65333fc89edb418d22164c275212e32b036d.tar.gz gdb-b41a65333fc89edb418d22164c275212e32b036d.tar.bz2 |
ld: Add minimal pdb generation
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/pe.em | 7 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index db90679..9072595 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -66,6 +66,7 @@ fragment <<EOF #include "ldctor.h" #include "ldbuildid.h" #include "coff/internal.h" +#include "pdb.h" /* FIXME: See bfd/peXXigen.c for why we include an architecture specific header in generic PE code. */ @@ -1353,6 +1354,12 @@ write_build_id (bfd *abfd) if (bfd_bwrite (contents, size, abfd) != size) return 0; + if (pdb) + { + if (!create_pdb_file (abfd, pdb_name, build_id)) + return 0; + } + /* Construct the CodeView record. */ CODEVIEW_INFO cvinfo; cvinfo.CVSignature = CVINFO_PDB70_CVSIGNATURE; diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 66cc61e..e2c538e 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -73,6 +73,7 @@ fragment <<EOF #include "ldctor.h" #include "ldbuildid.h" #include "coff/internal.h" +#include "pdb.h" /* FIXME: See bfd/peXXigen.c for why we include an architecture specific header in generic PE code. */ @@ -1345,6 +1346,12 @@ write_build_id (bfd *abfd) if (bfd_bwrite (contents, size, abfd) != size) return 0; + if (pdb) + { + if (!create_pdb_file (abfd, pdb_name, build_id)) + return 0; + } + /* Construct the CodeView record. */ CODEVIEW_INFO cvinfo; cvinfo.CVSignature = CVINFO_PDB70_CVSIGNATURE; |