Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, we might have a bug with scripts like below: .foo : ALIGN(8) { *(.foo) } > ram because do not expand the memory region when doing ALIGN. This might result in file range overlaps. The patch fixes the issue. Differential revision: https://reviews.llvm.org/D44730 llvm-svn: 328479
- Loading branch information
George Rimar
committed
Mar 26, 2018
1 parent
4398246
commit a6ce78e
Showing
3 changed files
with
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# REQUIRES: x86 | ||
# RUN: echo '.section .foo,"a"; .quad 0; .section .zed,"M",@progbits,1; .byte 0' > %t.s | ||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t.s -o %t.o | ||
|
||
MEMORY { | ||
ram (rwx): org = 0x1, len = 96K | ||
} | ||
|
||
SECTIONS { | ||
.foo : ALIGN(8) { | ||
*(.foo) | ||
} > ram | ||
|
||
.zed : { | ||
*(.zed) | ||
} > ram | ||
} | ||
|
||
# RUN: ld.lld %t.o -o %t --script %s | ||
# RUN: llvm-readobj -sections %t | FileCheck %s | ||
|
||
# CHECK: Name: .foo | ||
# CHECK-NEXT: Type: SHT_PROGBITS | ||
# CHECK-NEXT: Flags [ | ||
# CHECK-NEXT: SHF_ALLOC | ||
# CHECK-NEXT: ] | ||
# CHECK-NEXT: Address: 0x8 | ||
# CHECK-NEXT: Offset: 0x1008 | ||
# CHECK-NEXT: Size: 8 | ||
|
||
# CHECK: Name: .text | ||
# CHECK-NEXT: Type: SHT_PROGBITS | ||
# CHECK-NEXT: Flags [ | ||
# CHECK-NEXT: SHF_ALLOC | ||
# CHECK-NEXT: SHF_EXECINSTR | ||
# CHECK-NEXT: ] | ||
# CHECK-NEXT: Address: 0x10 | ||
# CHECK-NEXT: Offset: 0x1010 | ||
# CHECK-NEXT: Size: 0 | ||
|
||
# CHECK: Name: .zed | ||
# CHECK-NEXT: Type: SHT_PROGBITS | ||
# CHECK-NEXT: Flags [ | ||
# CHECK-NEXT: SHF_MERGE | ||
# CHECK-NEXT: ] | ||
# CHECK-NEXT: Address: 0x10 | ||
# CHECK-NEXT: Offset: 0x1010 | ||
# CHECK-NEXT: Size: 1 | ||
|
||
# CHECK: Name: .comment | ||
# CHECK-NEXT: Type: SHT_PROGBITS | ||
# CHECK-NEXT: Flags [ | ||
# CHECK-NEXT: SHF_MERGE | ||
# CHECK-NEXT: SHF_STRINGS | ||
# CHECK-NEXT: ] | ||
# CHECK-NEXT: Address: 0x0 | ||
# CHECK-NEXT: Offset: 0x1011 | ||
# CHECK-NEXT: Size: 8 |