-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLD][COFF] add __{data,bss}_{start,end}__ symbols for Cygwin support #136180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,99 @@ | ||
# REQUIRES: x86 | ||
# RUN: split-file %s %t.dir && cd %t.dir | ||
|
||
# RUN: llvm-mc -triple=x86_64-windows-cygnus -filetype=obj -o data-no-bss.obj data-no-bss.s | ||
# RUN: lld-link -lldmingw -entry:main data-no-bss.obj -out:data-no-bss.exe | ||
# RUN: llvm-objdump -s data-no-bss.exe | FileCheck --check-prefix=DATANOBSS %s | ||
|
||
# RUN: llvm-mc -triple=x86_64-windows-cygnus -filetype=obj -o bss-no-data.obj bss-no-data.s | ||
# RUN: lld-link -lldmingw -entry:main bss-no-data.obj -out:bss-no-data.exe | ||
# RUN: llvm-objdump -s bss-no-data.exe | FileCheck --check-prefix=BSSNODATA %s | ||
|
||
# RUN: llvm-mc -triple=x86_64-windows-cygnus -filetype=obj -o data-and-bss.obj data-and-bss.s | ||
# RUN: lld-link -lldmingw -entry:main data-and-bss.obj -out:data-and-bss.exe | ||
# RUN: llvm-objdump -s data-and-bss.exe | FileCheck --check-prefix=DATAANDBSS %s | ||
|
||
#--- data-no-bss.s | ||
.globl main | ||
main: | ||
nop | ||
|
||
.data | ||
.quad 1 | ||
.byte 2 | ||
|
||
.section .data_cygwin_nocopy, "w" | ||
.align 4 | ||
.quad 3 | ||
.byte 4 | ||
|
||
.section .test, "w" | ||
.quad __data_start__ | ||
.quad __data_end__ | ||
.quad __bss_start__ | ||
.quad __bss_end__ | ||
|
||
#--- bss-no-data.s | ||
.globl main | ||
main: | ||
nop | ||
|
||
.bss | ||
.zero 8192 | ||
|
||
.section .test, "w" | ||
.quad __data_start__ | ||
.quad __data_end__ | ||
.quad __bss_start__ | ||
.quad __bss_end__ | ||
|
||
#--- data-and-bss.s | ||
.globl main | ||
main: | ||
nop | ||
|
||
.data | ||
.quad 1 | ||
.byte 2 | ||
|
||
.section .data_cygwin_nocopy, "w" | ||
.align 4 | ||
.quad 3 | ||
.byte 4 | ||
|
||
.bss | ||
.zero 8192 | ||
|
||
.section .test, "w" | ||
.quad __data_start__ | ||
.quad __data_end__ | ||
.quad __bss_start__ | ||
.quad __bss_end__ | ||
|
||
# DATANOBSS: Contents of section .data: | ||
# DATANOBSS-NEXT: 140003000 01000000 00000000 02000000 03000000 | ||
# DATANOBSS-NEXT: 140003010 00000000 04 | ||
# __data_start__ pointing at 0x140003000 and | ||
# __data_end__ pointing at 0x140003009. | ||
# DATANOBSS-NEXT: Contents of section .test: | ||
# DATANOBSS-NEXT: 140004000 00300040 01000000 09300040 01000000 | ||
# DATANOBSS-NEXT: 140004010 18300040 01000000 18300040 01000000 | ||
|
||
# __bss_start__ pointing at 0x140003000 and | ||
# __bss_end__ pointing at 0x140005000. | ||
# BSSNODATA-NOT: Contents of section .data: | ||
# BSSNODATA: Contents of section .test: | ||
# BSSNODATA-NEXT: 140005000 00300040 01000000 00300040 01000000 | ||
# BSSNODATA-NEXT: 140005010 00300040 01000000 00500040 01000000 | ||
|
||
# DATAANDBSS: Contents of section .data: | ||
# DATAANDBSS-NEXT: 140003000 01000000 00000000 02000000 03000000 | ||
# DATAANDBSS-NEXT: 140003010 00000000 04000000 00000000 00000000 | ||
# __data_start__ pointing at 0x140003000 and | ||
# __data_end__ pointing at 0x140003009. | ||
# __bss_start__ pointing at 0x140003018 and | ||
# __bss_end__ pointing at 0x140005018. | ||
# DATAANDBSS: 1400031f0 00000000 00000000 00000000 00000000 | ||
# DATAANDBSS-NEXT: Contents of section .test: | ||
# DATAANDBSS-NEXT: 140006000 00300040 01000000 09300040 01000000 | ||
# DATAANDBSS-NEXT: 140006010 18300040 01000000 18500040 01000000 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.