-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[LLD][ELF] Fix SHF_MERGE misalignment when spilled #119289
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -310,17 +310,19 @@ SECTIONS { | |
| .byte 0x12, 0x34 | ||
|
|
||
| .section .b,"aM",@progbits,1 | ||
| .p2align 1 | ||
|
||
| .byte 0x12 | ||
|
|
||
| # RUN: llvm-mc -n -filetype=obj -triple=x86_64 merge.s -o merge.o | ||
|
|
||
| #--- spill-merge.lds | ||
| ## SHF_MERGE sections are spilled according to the class refs of the first | ||
| ## merged input section (the one giving the resulting section its name). | ||
| ## Spills take into account increases in section alignment due to merging. | ||
| MEMORY { | ||
| a : ORIGIN = 0, LENGTH = 1 | ||
| b : ORIGIN = 1, LENGTH = 2 | ||
| c : ORIGIN = 3, LENGTH = 2 | ||
| b : ORIGIN = 1, LENGTH = 4 | ||
| c : ORIGIN = 5, LENGTH = 4 | ||
| } | ||
|
|
||
| SECTIONS { | ||
|
|
@@ -336,8 +338,8 @@ SECTIONS { | |
|
|
||
| # SPILL-MERGE: Name Type Address Off Size | ||
| # SPILL-MERGE: .first PROGBITS 0000000000000000 000190 000000 | ||
| # SPILL-MERGE-NEXT: .second PROGBITS 0000000000000001 001001 000002 | ||
| # SPILL-MERGE-NEXT: .third PROGBITS 0000000000000003 001003 000000 | ||
| # SPILL-MERGE-NEXT: .second PROGBITS 0000000000000002 001002 000003 | ||
| # SPILL-MERGE-NEXT: .third PROGBITS 0000000000000006 001006 000000 | ||
|
|
||
| #--- link-order.s | ||
| .section .a,"a",@progbits | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
empty()test is redundantThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.