-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LLD][COFF] add __buildid symbol. (#74652)
After #71433, lld-link is able to always generate build id even when PDB is not generated. This adds the `__buildid` symbol to points to the start of 16 bytes guid (which is after `RSDS`) and allows profile runtime to access it and dump it to raw profile.
- Loading branch information
Showing
5 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# REQUIRES: x86 | ||
# RUN: llvm-mc -triple=x86_64-windows-msvc -filetype=obj -o %t.obj %s | ||
# RUN: lld-link -debug:symtab -entry:main %t.obj -build-id -Brepro -out:%t.exe | ||
# RUN: llvm-objdump -s -t %t.exe | FileCheck %s | ||
|
||
# Check __buildid points to 0x14000203c which is after the signature RSDS. | ||
|
||
# CHECK: SYMBOL TABLE: | ||
# CHECK-NEXT: 0x0000003c __buildid | ||
# CHECK: Contents of section .rdata: | ||
# CHECK-NEXT: 140002000 | ||
# CHECK-NEXT: 140002010 | ||
# CHECK-NEXT: 140002020 | ||
# CHECK-NEXT: 140002030 {{.*}} {{.*}} 52534453 {{.*}} | ||
# CHECK-NEXT: 140002040 | ||
|
||
.globl main | ||
main: | ||
nop | ||
|
||
.section .bss,"bw",discard,__buildid | ||
.global __buildid | ||
__buildid: |