Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELF] -M/-Map: fix VMA/LMA/Size columns of symbol assignments when ad…
…dress/size>=2**32 SymbolAssignment::addr stores the location counter. The type should be uint64_t instead of unsigned. The upper half of the address space is commonly used by operating system kernels. Similarly, SymbolAssignment::size should be an uint64_t. A kernel linker script can move the location counter from 0 to the upper half of the address space. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D77445
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# REQUIRES: x86 | ||
## Test how we display the upper half of the address space, which is commonly | ||
## used by operating system kernels. | ||
|
||
# RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o %t.o | ||
# RUN: ld.lld -M -T %s %t.o -o /dev/null | FileCheck %s --match-full-lines --strict-whitespace | ||
|
||
## . = 0xffffffff80000000; has a misaligned Size column. | ||
# CHECK: VMA LMA Size Align Out In Symbol | ||
# CHECK-NEXT: 0 0 ffffffff80000000 1 . = 0xffffffff80000000 | ||
# CHECK-NEXT:ffffffff80000000 0 100000 1 . += 0x100000 | ||
# CHECK-NEXT:ffffffff80100000 0 0 1 _text = . | ||
# CHECK-NEXT:ffffffff80100000 ffffffff80100000 0 4 .text | ||
|
||
SECTIONS { | ||
. = 0xffffffff80000000; | ||
. += 0x100000; | ||
_text = .; | ||
} |