Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-objcopy][ObjectYAML][mips] Add MIPS specific ELF section indexes
This fixes #53998 and displays correct information in obj2yaml for SHN_MIPS_* sections according to https://refspecs.linuxfoundation.org/elf/mipsabi.pdf Reviewed By: jhenderson, MaskRay Differential Revision: https://reviews.llvm.org/D123902
- Loading branch information
Showing
8 changed files
with
120 additions
and
20 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
15 changes: 0 additions & 15 deletions
15
llvm/test/tools/llvm-objcopy/ELF/hexagon-unsupported-on-x86.test
This file was deleted.
Oops, something went wrong.
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,62 @@ | ||
# RUN: yaml2obj %s -o %t | ||
# RUN: llvm-objcopy %t %t2 | ||
# RUN: llvm-readobj --symbols %t2 | FileCheck %s | ||
|
||
!ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_EXEC | ||
Machine: EM_MIPS | ||
Symbols: | ||
- Name: test_mips_acommon | ||
Index: SHN_MIPS_ACOMMON | ||
Value: 0x1234 | ||
Binding: STB_GLOBAL | ||
- Name: test_mips_scommon | ||
Index: SHN_MIPS_SCOMMON | ||
Value: 0x1237 | ||
Binding: STB_GLOBAL | ||
- Name: test_mips_sundefined | ||
Index: SHN_MIPS_SUNDEFINED | ||
Value: 0x1238 | ||
Binding: STB_GLOBAL | ||
|
||
# CHECK: Symbols [ | ||
# CHECK-NEXT: Symbol { | ||
# CHECK-NEXT: Name: | ||
# CHECK-NEXT: Value: 0x0 | ||
# CHECK-NEXT: Size: 0 | ||
# CHECK-NEXT: Binding: Local (0x0) | ||
# CHECK-NEXT: Type: None (0x0) | ||
# CHECK-NEXT: Other: 0 | ||
# CHECK-NEXT: Section: Undefined (0x0) | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT: Symbol { | ||
# CHECK-NEXT: Name: test_mips_acommon | ||
# CHECK-NEXT: Value: 0x1234 | ||
# CHECK-NEXT: Size: 0 | ||
# CHECK-NEXT: Binding: Global (0x1) | ||
# CHECK-NEXT: Type: None (0x0) | ||
# CHECK-NEXT: Other: 0 | ||
# CHECK-NEXT: Section: Processor Specific (0xFF00) | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT: Symbol { | ||
# CHECK-NEXT: Name: test_mips_scommon | ||
# CHECK-NEXT: Value: 0x1237 | ||
# CHECK-NEXT: Size: 0 | ||
# CHECK-NEXT: Binding: Global (0x1) | ||
# CHECK-NEXT: Type: None (0x0) | ||
# CHECK-NEXT: Other: 0 | ||
# CHECK-NEXT: Section: Processor Specific (0xFF03) | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT: Symbol { | ||
# CHECK-NEXT: Name: test_mips_sundefined | ||
# CHECK-NEXT: Value: 0x1238 | ||
# CHECK-NEXT: Size: 0 | ||
# CHECK-NEXT: Binding: Global (0x1) | ||
# CHECK-NEXT: Type: None (0x0) | ||
# CHECK-NEXT: Other: 0 | ||
# CHECK-NEXT: Section: Processor Specific (0xFF04) | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT:] |
17 changes: 17 additions & 0 deletions
17
llvm/test/tools/llvm-objcopy/ELF/unsupported-machine-specific-shndx.test
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,17 @@ | ||
# RUN: yaml2obj %s -o %t -DMACHINE=HEXAGON | ||
# RUN: not llvm-objcopy %t %t2 2>&1 >/dev/null | FileCheck %s -DINDEX=65280 | ||
# RUN: yaml2obj %s -o %t -DMACHINE=MIPS | ||
# RUN: not llvm-objcopy %t %t2 2>&1 >/dev/null | FileCheck %s -DINDEX=65283 | ||
|
||
!ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_EXEC | ||
Machine: EM_X86_64 | ||
Symbols: | ||
- Name: test | ||
Index: SHN_[[MACHINE]]_SCOMMON | ||
Binding: STB_GLOBAL | ||
|
||
# CHECK: symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: [[INDEX]] |
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