diff options
author | Joshua Lang <joshualang@google.com> | 2017-02-02 20:27:46 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-02-02 20:27:46 +0000 |
commit | 07fbdd68b5ae77c35f0ffa8d13ab88eb22e28137 (patch) | |
tree | a6fb4e5541581d7bf6925b298bcb3f4910836bc4 /binutils-2.25/ld/emultempl/pep.em | |
parent | fc509c90be69651fbc0a7fff56341eb4cc51b16d (diff) | |
parent | 29a2cb0cb55b67fbd43bf6271a79b3a702ffa79b (diff) | |
download | toolchain_binutils-07fbdd68b5ae77c35f0ffa8d13ab88eb22e28137.tar.gz toolchain_binutils-07fbdd68b5ae77c35f0ffa8d13ab88eb22e28137.tar.bz2 toolchain_binutils-07fbdd68b5ae77c35f0ffa8d13ab88eb22e28137.zip |
Set CodeView pdb path/name to base name am: 9bf6cbf6dd am: 22eb558f95
am: 29a2cb0cb5
Change-Id: I5c30a5bd2bebd75327a6105e7906b9a06f6af94d
Diffstat (limited to 'binutils-2.25/ld/emultempl/pep.em')
-rw-r--r-- | binutils-2.25/ld/emultempl/pep.em | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/binutils-2.25/ld/emultempl/pep.em b/binutils-2.25/ld/emultempl/pep.em index b24a6082..100d4ef4 100644 --- a/binutils-2.25/ld/emultempl/pep.em +++ b/binutils-2.25/ld/emultempl/pep.em @@ -1288,6 +1288,9 @@ write_build_id (bfd *abfd) return TRUE; } + const char * pdb_name = _bfd_XXi_get_codeview_pdb_name (abfd); + unsigned int pdb_name_length = strlen(pdb_name); + if (t->build_id.sec->contents == NULL) t->build_id.sec->contents = (unsigned char *) xmalloc (t->build_id.sec->size); contents = t->build_id.sec->contents; @@ -1306,7 +1309,7 @@ write_build_id (bfd *abfd) idd.MajorVersion = 0; idd.MinorVersion = 0; idd.Type = PE_IMAGE_DEBUG_TYPE_CODEVIEW; - idd.SizeOfData = sizeof (CV_INFO_PDB70) + 1; + idd.SizeOfData = sizeof (CV_INFO_PDB70) + pdb_name_length + 1; idd.AddressOfRawData = asec->vma - ib + link_order->offset + sizeof (struct external_IMAGE_DEBUG_DIRECTORY); idd.PointerToRawData = asec->filepos + link_order->offset @@ -1370,12 +1373,12 @@ setup_build_id (bfd *ibfd) t->build_id.style = emit_build_id; t->build_id.sec = s; - /* Section is a fixed size: + /* Section is a variable size: One IMAGE_DEBUG_DIRECTORY entry, of type IMAGE_DEBUG_TYPE_CODEVIEW, pointing at a CV_INFO_PDB70 record containing the build-id, with a - null byte for PdbFileName. */ + null terminated string for PdbFileName. */ s->size = sizeof (struct external_IMAGE_DEBUG_DIRECTORY) - + sizeof (CV_INFO_PDB70) + 1; + + sizeof (CV_INFO_PDB70) + strlen(_bfd_XXi_get_codeview_pdb_name(link_info.output_bfd)) + 1; return TRUE; } |