[yaml2obj][obj2yaml] - Change how symbol's binding is descibed when parsing/dumping.

Currently, YAML has the following syntax for describing the symbols:

Symbols:
  Local:
    LocalSymbol1:
    ...
    LocalSymbol2:
    ...
  ...
  Global:
    GlobalSymbol1:
  ...
  Weak:
  ...
  GNUUnique:

I.e. symbols are grouped by their bindings. That is not very convenient,
because:

It does not allow to set a custom binding, what can be useful for producing
broken/special outputs for test cases. Adding a new binding would require to
change a syntax (what we observed when added GNUUnique recently).

It does not allow to change the order of the symbols in .symtab/.dynsym,
i.e. currently all Local symbols are placed first, then Global, Weak and GNUUnique
are following, but we are not able to change the order.

It is not consistent. Binding is just one of the properties of the symbol,
we do not group them by other properties.

It makes the code more complex that it can be. This patch shows it can be simplified
with the change performed.

The patch changes the syntax to just:

Symbols:
  Symbol1:
  ...
  Symbol2:
  ...
...

With that, we are able to work with the binding field just like with any other symbol property.

Differential revision: https://reviews.llvm.org/D60122

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357595 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
George Rimar 2019-04-03 14:53:42 +00:00
parent f576f8bf7d
commit 26db7fb2ec
119 changed files with 1409 additions and 1342 deletions

View File

@ -52,6 +52,7 @@ LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_RSS)
// Just use 64, since it can hold 32-bit values too. // Just use 64, since it can hold 32-bit values too.
LLVM_YAML_STRONG_TYPEDEF(uint64_t, ELF_SHF) LLVM_YAML_STRONG_TYPEDEF(uint64_t, ELF_SHF)
LLVM_YAML_STRONG_TYPEDEF(uint16_t, ELF_SHN) LLVM_YAML_STRONG_TYPEDEF(uint16_t, ELF_SHN)
LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STB)
LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STT) LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STT)
LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STV) LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STV)
LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STO) LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STO)
@ -97,18 +98,12 @@ struct Symbol {
ELF_STT Type; ELF_STT Type;
StringRef Section; StringRef Section;
Optional<ELF_SHN> Index; Optional<ELF_SHN> Index;
ELF_STB Binding;
llvm::yaml::Hex64 Value; llvm::yaml::Hex64 Value;
llvm::yaml::Hex64 Size; llvm::yaml::Hex64 Size;
uint8_t Other; uint8_t Other;
}; };
struct SymbolsDef {
std::vector<Symbol> Local;
std::vector<Symbol> Global;
std::vector<Symbol> Weak;
std::vector<Symbol> GNUUnique;
};
struct SectionOrType { struct SectionOrType {
StringRef sectionNameOrType; StringRef sectionNameOrType;
}; };
@ -289,8 +284,8 @@ struct Object {
// cleaner and nicer if we read them from the YAML as a separate // cleaner and nicer if we read them from the YAML as a separate
// top-level key, which automatically ensures that invariants like there // top-level key, which automatically ensures that invariants like there
// being a single SHT_SYMTAB section are upheld. // being a single SHT_SYMTAB section are upheld.
SymbolsDef Symbols; std::vector<Symbol> Symbols;
SymbolsDef DynamicSymbols; std::vector<Symbol> DynamicSymbols;
}; };
} // end namespace ELFYAML } // end namespace ELFYAML
@ -362,6 +357,10 @@ template <> struct ScalarEnumerationTraits<ELFYAML::ELF_SHN> {
static void enumeration(IO &IO, ELFYAML::ELF_SHN &Value); static void enumeration(IO &IO, ELFYAML::ELF_SHN &Value);
}; };
template <> struct ScalarEnumerationTraits<ELFYAML::ELF_STB> {
static void enumeration(IO &IO, ELFYAML::ELF_STB &Value);
};
template <> template <>
struct ScalarEnumerationTraits<ELFYAML::ELF_STT> { struct ScalarEnumerationTraits<ELFYAML::ELF_STT> {
static void enumeration(IO &IO, ELFYAML::ELF_STT &Value); static void enumeration(IO &IO, ELFYAML::ELF_STT &Value);
@ -437,10 +436,6 @@ struct MappingTraits<ELFYAML::Symbol> {
static StringRef validate(IO &IO, ELFYAML::Symbol &Symbol); static StringRef validate(IO &IO, ELFYAML::Symbol &Symbol);
}; };
template <> struct MappingTraits<ELFYAML::SymbolsDef> {
static void mapping(IO &IO, ELFYAML::SymbolsDef &Symbols);
};
template <> struct MappingTraits<ELFYAML::DynamicEntry> { template <> struct MappingTraits<ELFYAML::DynamicEntry> {
static void mapping(IO &IO, ELFYAML::DynamicEntry &Rel); static void mapping(IO &IO, ELFYAML::DynamicEntry &Rel);
}; };

View File

@ -560,6 +560,17 @@ void ScalarEnumerationTraits<ELFYAML::ELF_SHN>::enumeration(
IO.enumFallback<Hex32>(Value); IO.enumFallback<Hex32>(Value);
} }
void ScalarEnumerationTraits<ELFYAML::ELF_STB>::enumeration(
IO &IO, ELFYAML::ELF_STB &Value) {
#define ECase(X) IO.enumCase(Value, #X, ELF::X)
ECase(STB_LOCAL);
ECase(STB_GLOBAL);
ECase(STB_WEAK);
ECase(STB_GNU_UNIQUE);
#undef ECase
IO.enumFallback<Hex8>(Value);
}
void ScalarEnumerationTraits<ELFYAML::ELF_STT>::enumeration( void ScalarEnumerationTraits<ELFYAML::ELF_STT>::enumeration(
IO &IO, ELFYAML::ELF_STT &Value) { IO &IO, ELFYAML::ELF_STT &Value) {
#define ECase(X) IO.enumCase(Value, #X, ELF::X) #define ECase(X) IO.enumCase(Value, #X, ELF::X)
@ -845,9 +856,9 @@ void MappingTraits<ELFYAML::Symbol>::mapping(IO &IO, ELFYAML::Symbol &Symbol) {
IO.mapOptional("Type", Symbol.Type, ELFYAML::ELF_STT(0)); IO.mapOptional("Type", Symbol.Type, ELFYAML::ELF_STT(0));
IO.mapOptional("Section", Symbol.Section, StringRef()); IO.mapOptional("Section", Symbol.Section, StringRef());
IO.mapOptional("Index", Symbol.Index); IO.mapOptional("Index", Symbol.Index);
IO.mapOptional("Binding", Symbol.Binding, ELFYAML::ELF_STB(0));
IO.mapOptional("Value", Symbol.Value, Hex64(0)); IO.mapOptional("Value", Symbol.Value, Hex64(0));
IO.mapOptional("Size", Symbol.Size, Hex64(0)); IO.mapOptional("Size", Symbol.Size, Hex64(0));
MappingNormalization<NormalizedOther, uint8_t> Keys(IO, Symbol.Other); MappingNormalization<NormalizedOther, uint8_t> Keys(IO, Symbol.Other);
IO.mapOptional("Visibility", Keys->Visibility, ELFYAML::ELF_STV(0)); IO.mapOptional("Visibility", Keys->Visibility, ELFYAML::ELF_STV(0));
IO.mapOptional("Other", Keys->Other, ELFYAML::ELF_STO(0)); IO.mapOptional("Other", Keys->Other, ELFYAML::ELF_STO(0));
@ -864,14 +875,6 @@ StringRef MappingTraits<ELFYAML::Symbol>::validate(IO &IO,
return StringRef(); return StringRef();
} }
void MappingTraits<ELFYAML::SymbolsDef>::mapping(IO &IO,
ELFYAML::SymbolsDef &Symbols) {
IO.mapOptional("Local", Symbols.Local);
IO.mapOptional("Global", Symbols.Global);
IO.mapOptional("Weak", Symbols.Weak);
IO.mapOptional("GNUUnique", Symbols.GNUUnique);
}
static void commonSectionMapping(IO &IO, ELFYAML::Section &Section) { static void commonSectionMapping(IO &IO, ELFYAML::Section &Section) {
IO.mapOptional("Name", Section.Name, StringRef()); IO.mapOptional("Name", Section.Name, StringRef());
IO.mapRequired("Type", Section.Type); IO.mapRequired("Type", Section.Type);

View File

@ -28,8 +28,8 @@ Sections:
Symbol: _start Symbol: _start
Type: 0xFF Type: 0xFF
Symbols: Symbols:
Global: - Name: _start
- Name: _start Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x0
Value: 0x0 Binding: STB_GLOBAL

View File

@ -43,13 +43,11 @@ Sections:
Addend: 0 Addend: 0
Symbols: Symbols:
Local: - Name: .text
- Name: .text Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Name: main
Type: STT_FUNC
Global: Section: .text
- Name: main Size: 0x08
Type: STT_FUNC Binding: STB_GLOBAL
Section: .text
Size: 0x08

View File

@ -65,13 +65,11 @@ Sections:
Type: R_AMDGPU_RELATIVE64 Type: R_AMDGPU_RELATIVE64
Symbols: Symbols:
Local: - Name: .text
- Name: .text Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Name: main
Type: STT_FUNC
Global: Section: .text
- Name: main Size: 0x08
Type: STT_FUNC Binding: STB_GLOBAL
Section: .text
Size: 0x08

View File

@ -49,13 +49,11 @@ Sections:
Symbols: Symbols:
Local: - Name: .text
- Name: .text Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Name: main
Type: STT_FUNC
Global: Section: .text
- Name: main Size: 0x08
Type: STT_FUNC Binding: STB_GLOBAL
Section: .text
Size: 0x08

View File

@ -59,7 +59,6 @@ Sections:
Flags2: 0x0 Flags2: 0x0
Symbols: Symbols:
Local: - Name: .MIPS.abiflags
- Name: .MIPS.abiflags Type: STT_SECTION
Type: STT_SECTION Section: .MIPS.abiflags
Section: .MIPS.abiflags

View File

@ -62,11 +62,11 @@ Sections:
Size: 4 Size: 4
Symbols: Symbols:
Global: - Name: T1
- Name: T1 Section: .text
Section: .text Value: 0
Value: 0 Size: 4
Size: 4 Binding: STB_GLOBAL
# o64 # o64
--- !ELF --- !ELF
@ -84,11 +84,11 @@ Sections:
Size: 4 Size: 4
Symbols: Symbols:
Global: - Name: T1
- Name: T1 Section: .text
Section: .text Value: 0
Value: 0 Size: 4
Size: 4 Binding: STB_GLOBAL
# eabio32 # eabio32
--- !ELF --- !ELF
@ -106,11 +106,11 @@ Sections:
Size: 4 Size: 4
Symbols: Symbols:
Global: - Name: T1
- Name: T1 Section: .text
Section: .text Value: 0
Value: 0 Size: 4
Size: 4 Binding: STB_GLOBAL
# eabi64 # eabi64
--- !ELF --- !ELF
@ -128,9 +128,9 @@ Sections:
Size: 4 Size: 4
Symbols: Symbols:
Global: - Name: T1
- Name: T1 Section: .text
Section: .text Value: 0
Value: 0 Size: 4
Size: 4 Binding: STB_GLOBAL
... ...

View File

@ -44,9 +44,9 @@ Sections:
Size: 4 Size: 4
Symbols: Symbols:
Global: - Name: T1
- Name: T1 Section: .text
Section: .text Value: 0
Value: 0 Size: 4
Size: 4 Binding: STB_GLOBAL
... ...

View File

@ -98,17 +98,17 @@ Sections:
Size: 0x0F Size: 0x0F
Symbols: Symbols:
Local: - Name: .text
- Name: .text Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Name: .rodata
- Name: .rodata Type: STT_SECTION
Type: STT_SECTION Section: .rodata
Section: .rodata - Name: main
Global: Type: STT_FUNC
- Name: main Section: .text
Type: STT_FUNC Size: 0x58
Section: .text Binding: STB_GLOBAL
Size: 0x58 - Name: printf
- Name: printf Binding: STB_GLOBAL
... ...

View File

@ -28,5 +28,5 @@ Sections:
Symbol: main Symbol: main
Type: 0xFF Type: 0xFF
Symbols: Symbols:
Global: - Name: main
- Name: main Binding: STB_GLOBAL

View File

@ -30,13 +30,11 @@ Sections:
Type: R_386_32 Type: R_386_32
Symbols: Symbols:
Local: - Name: .text
- Name: .text Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Name: main
Type: STT_FUNC
Global: Section: .text
- Name: main Size: 0x08
Type: STT_FUNC Binding: STB_GLOBAL
Section: .text
Size: 0x08

View File

@ -24,16 +24,16 @@ CHECK-NEXT: - Offset: 0x0000000000000000
CHECK-NEXT: Symbol: '' CHECK-NEXT: Symbol: ''
CHECK-NEXT: Type: R_X86_64_NONE CHECK-NEXT: Type: R_X86_64_NONE
CHECK-NEXT: Symbols: CHECK-NEXT: Symbols:
CHECK-NEXT: Local:
CHECK-NEXT: - Name: rb_ary_new_capa CHECK-NEXT: - Name: rb_ary_new_capa
CHECK-NEXT: Type: STT_FUNC CHECK-NEXT: Type: STT_FUNC
CHECK-NEXT: Section: .text CHECK-NEXT: Section: .text
CHECK-NEXT: Size: 0x0000000000000005 CHECK-NEXT: Size: 0x0000000000000005
CHECK-NEXT: Global:
CHECK-NEXT: - Name: __dtraceenabled_ruby___array-create CHECK-NEXT: - Name: __dtraceenabled_ruby___array-create
CHECK-NEXT: Index: SHN_ABS CHECK-NEXT: Index: SHN_ABS
CHECK-NEXT: Binding: STB_GLOBAL
CHECK-NEXT: - Name: '$dtrace1316529.rb_ary_new_capa' CHECK-NEXT: - Name: '$dtrace1316529.rb_ary_new_capa'
CHECK-NEXT: Type: STT_FUNC CHECK-NEXT: Type: STT_FUNC
CHECK-NEXT: Section: .text CHECK-NEXT: Section: .text
CHECK-NEXT: Binding: STB_GLOBAL
CHECK-NEXT: Size: 0x0000000000000005 CHECK-NEXT: Size: 0x0000000000000005
CHECK-NEXT: Visibility: STV_HIDDEN CHECK-NEXT: Visibility: STV_HIDDEN

View File

@ -421,7 +421,6 @@ ELF-MIPSEL-NEXT: GPRSize: REG_32
ELF-MIPSEL-NEXT: CPR1Size: REG_32 ELF-MIPSEL-NEXT: CPR1Size: REG_32
ELF-MIPSEL-NEXT: Flags1: [ ODDSPREG ] ELF-MIPSEL-NEXT: Flags1: [ ODDSPREG ]
ELF-MIPSEL-NEXT: Symbols: ELF-MIPSEL-NEXT: Symbols:
ELF-MIPSEL-NEXT: Local:
ELF-MIPSEL-NEXT: - Name: trivial.ll ELF-MIPSEL-NEXT: - Name: trivial.ll
ELF-MIPSEL-NEXT: Type: STT_FILE ELF-MIPSEL-NEXT: Type: STT_FILE
ELF-MIPSEL-NEXT: Index: SHN_ABS ELF-MIPSEL-NEXT: Index: SHN_ABS
@ -450,18 +449,22 @@ ELF-MIPSEL-NEXT: Section: .reginfo
ELF-MIPSEL-NEXT: - Name: .MIPS.abiflags ELF-MIPSEL-NEXT: - Name: .MIPS.abiflags
ELF-MIPSEL-NEXT: Type: STT_SECTION ELF-MIPSEL-NEXT: Type: STT_SECTION
ELF-MIPSEL-NEXT: Section: .MIPS.abiflags ELF-MIPSEL-NEXT: Section: .MIPS.abiflags
ELF-MIPSEL-NEXT: Global:
ELF-MIPSEL-NEXT: - Name: main ELF-MIPSEL-NEXT: - Name: main
ELF-MIPSEL-NEXT: Type: STT_FUNC ELF-MIPSEL-NEXT: Type: STT_FUNC
ELF-MIPSEL-NEXT: Section: .text ELF-MIPSEL-NEXT: Section: .text
ELF-MIPSEL-NEXT: Binding: STB_GLOBAL
ELF-MIPSEL-NEXT: Size: 0x000000000000004C ELF-MIPSEL-NEXT: Size: 0x000000000000004C
ELF-MIPSEL-NEXT: - Name: var ELF-MIPSEL-NEXT: - Name: var
ELF-MIPSEL-NEXT: Type: STT_OBJECT ELF-MIPSEL-NEXT: Type: STT_OBJECT
ELF-MIPSEL-NEXT: Section: .bss ELF-MIPSEL-NEXT: Section: .bss
ELF-MIPSEL-NEXT: Binding: STB_GLOBAL
ELF-MIPSEL-NEXT: Size: 0x0000000000000004 ELF-MIPSEL-NEXT: Size: 0x0000000000000004
ELF-MIPSEL-NEXT: - Name: SomeOtherFunction ELF-MIPSEL-NEXT: - Name: SomeOtherFunction
ELF-MIPSEL-NEXT: Binding: STB_GLOBAL
ELF-MIPSEL-NEXT: - Name: _gp_disp ELF-MIPSEL-NEXT: - Name: _gp_disp
ELF-MIPSEL-NEXT: Binding: STB_GLOBAL
ELF-MIPSEL-NEXT: - Name: puts ELF-MIPSEL-NEXT: - Name: puts
ELF-MIPSEL-NEXT: Binding: STB_GLOBAL
ELF-MIPS64EL: FileHeader: ELF-MIPS64EL: FileHeader:
ELF-MIPS64EL-NEXT: Class: ELFCLASS64 ELF-MIPS64EL-NEXT: Class: ELFCLASS64
@ -505,7 +508,6 @@ ELF-MIPS64EL-NEXT: Type: SHT_PROGBITS
ELF-MIPS64EL-NEXT: AddressAlign: 0x0000000000000004 ELF-MIPS64EL-NEXT: AddressAlign: 0x0000000000000004
ELF-MIPS64EL-NEXT: Content: '' ELF-MIPS64EL-NEXT: Content: ''
ELF-MIPS64EL-NEXT: Symbols: ELF-MIPS64EL-NEXT: Symbols:
ELF-MIPS64EL-NEXT: Local:
ELF-MIPS64EL-NEXT: - Name: .text ELF-MIPS64EL-NEXT: - Name: .text
ELF-MIPS64EL-NEXT: Type: STT_SECTION ELF-MIPS64EL-NEXT: Type: STT_SECTION
ELF-MIPS64EL-NEXT: Section: .text ELF-MIPS64EL-NEXT: Section: .text
@ -523,8 +525,8 @@ ELF-MIPS64EL-NEXT: Section: .MIPS.options
ELF-MIPS64EL-NEXT: - Name: .pdr ELF-MIPS64EL-NEXT: - Name: .pdr
ELF-MIPS64EL-NEXT: Type: STT_SECTION ELF-MIPS64EL-NEXT: Type: STT_SECTION
ELF-MIPS64EL-NEXT: Section: .pdr ELF-MIPS64EL-NEXT: Section: .pdr
ELF-MIPS64EL-NEXT: Global:
ELF-MIPS64EL-NEXT: - Name: zed ELF-MIPS64EL-NEXT: - Name: zed
ELF-MIPS64EL-NEXT: Binding: STB_GLOBAL
ELF-X86-64: FileHeader: ELF-X86-64: FileHeader:
ELF-X86-64-NEXT: Class: ELFCLASS64 ELF-X86-64-NEXT: Class: ELFCLASS64
@ -569,7 +571,6 @@ ELF-X86-64-NEXT: Symbol: SomeOtherFunction
ELF-X86-64-NEXT: Type: R_X86_64_PC32 ELF-X86-64-NEXT: Type: R_X86_64_PC32
ELF-X86-64-NEXT: Addend: -4 ELF-X86-64-NEXT: Addend: -4
ELF-X86-64-NEXT: Symbols: ELF-X86-64-NEXT: Symbols:
ELF-X86-64-NEXT: Local:
ELF-X86-64-NEXT: - Name: trivial-object-test.s ELF-X86-64-NEXT: - Name: trivial-object-test.s
ELF-X86-64-NEXT: Type: STT_FILE ELF-X86-64-NEXT: Type: STT_FILE
ELF-X86-64-NEXT: Index: SHN_ABS ELF-X86-64-NEXT: Index: SHN_ABS
@ -582,14 +583,15 @@ ELF-X86-64-NEXT: Section: .rodata.str1.1
ELF-X86-64-NEXT: - Name: .note.GNU-stack ELF-X86-64-NEXT: - Name: .note.GNU-stack
ELF-X86-64-NEXT: Type: STT_SECTION ELF-X86-64-NEXT: Type: STT_SECTION
ELF-X86-64-NEXT: Section: .note.GNU-stack ELF-X86-64-NEXT: Section: .note.GNU-stack
ELF-X86-64-NEXT: Global:
ELF-X86-64-NEXT: - Name: main ELF-X86-64-NEXT: - Name: main
ELF-X86-64-NEXT: Type: STT_FUNC ELF-X86-64-NEXT: Type: STT_FUNC
ELF-X86-64-NEXT: Section: .text ELF-X86-64-NEXT: Section: .text
ELF-X86-64-NEXT: Binding: STB_GLOBAL
ELF-X86-64-NEXT: Size: 0x0000000000000026 ELF-X86-64-NEXT: Size: 0x0000000000000026
ELF-X86-64-NEXT: - Name: SomeOtherFunction ELF-X86-64-NEXT: - Name: SomeOtherFunction
ELF-X86-64-NEXT: Binding: STB_GLOBAL
ELF-X86-64-NEXT: - Name: puts ELF-X86-64-NEXT: - Name: puts
ELF-X86-64-NEXT: Binding: STB_GLOBAL
ELF-AVR: FileHeader: ELF-AVR: FileHeader:
ELF-AVR-NEXT: Class: ELFCLASS32 ELF-AVR-NEXT: Class: ELFCLASS32
@ -610,7 +612,6 @@ ELF-AVR-NEXT: Address: 0x0000000000800060
ELF-AVR-NEXT: AddressAlign: 0x0000000000000001 ELF-AVR-NEXT: AddressAlign: 0x0000000000000001
ELF-AVR-NEXT: Content: '' ELF-AVR-NEXT: Content: ''
ELF-AVR-NEXT: Symbols: ELF-AVR-NEXT: Symbols:
ELF-AVR-NEXT: Local:
ELF-AVR-NEXT: - Name: .text ELF-AVR-NEXT: - Name: .text
ELF-AVR-NEXT: Type: STT_SECTION ELF-AVR-NEXT: Type: STT_SECTION
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
@ -623,39 +624,49 @@ ELF-AVR-NEXT: Type: STT_FILE
ELF-AVR-NEXT: Index: SHN_ABS ELF-AVR-NEXT: Index: SHN_ABS
ELF-AVR-NEXT: - Name: main ELF-AVR-NEXT: - Name: main
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
ELF-AVR-NEXT: Global:
ELF-AVR-NEXT: - Name: __trampolines_start ELF-AVR-NEXT: - Name: __trampolines_start
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: - Name: _etext ELF-AVR-NEXT: - Name: _etext
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: Value: 0x0000000000000004 ELF-AVR-NEXT: Value: 0x0000000000000004
ELF-AVR-NEXT: - Name: __data_load_end ELF-AVR-NEXT: - Name: __data_load_end
ELF-AVR-NEXT: Index: SHN_ABS ELF-AVR-NEXT: Index: SHN_ABS
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: Value: 0x0000000000000004 ELF-AVR-NEXT: Value: 0x0000000000000004
ELF-AVR-NEXT: - Name: __trampolines_end ELF-AVR-NEXT: - Name: __trampolines_end
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: - Name: __data_load_start ELF-AVR-NEXT: - Name: __data_load_start
ELF-AVR-NEXT: Index: SHN_ABS ELF-AVR-NEXT: Index: SHN_ABS
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: Value: 0x0000000000000004 ELF-AVR-NEXT: Value: 0x0000000000000004
ELF-AVR-NEXT: - Name: __dtors_end ELF-AVR-NEXT: - Name: __dtors_end
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: - Name: __eeprom_end ELF-AVR-NEXT: - Name: __eeprom_end
ELF-AVR-NEXT: Section: .data ELF-AVR-NEXT: Section: .data
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: Value: 0x0000000000810000 ELF-AVR-NEXT: Value: 0x0000000000810000
ELF-AVR-NEXT: - Name: __ctors_start ELF-AVR-NEXT: - Name: __ctors_start
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: - Name: __dtors_start ELF-AVR-NEXT: - Name: __dtors_start
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: - Name: __ctors_end ELF-AVR-NEXT: - Name: __ctors_end
ELF-AVR-NEXT: Section: .text ELF-AVR-NEXT: Section: .text
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: - Name: _edata ELF-AVR-NEXT: - Name: _edata
ELF-AVR-NEXT: Section: .data ELF-AVR-NEXT: Section: .data
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: Value: 0x0000000000800060 ELF-AVR-NEXT: Value: 0x0000000000800060
ELF-AVR-NEXT: - Name: _end ELF-AVR-NEXT: - Name: _end
ELF-AVR-NEXT: Section: .data ELF-AVR-NEXT: Section: .data
ELF-AVR-NEXT: Binding: STB_GLOBAL
ELF-AVR-NEXT: Value: 0x0000000000800060 ELF-AVR-NEXT: Value: 0x0000000000800060
WASM: --- !WASM WASM: --- !WASM
WASM-NEXT: FileHeader: WASM-NEXT: FileHeader:
WASM-NEXT: Version: 0x00000001 WASM-NEXT: Version: 0x00000001

View File

@ -41,13 +41,14 @@ Sections:
Size: 4 Size: 4
Symbols: Symbols:
Global: - Name: T0
- Name: T0 Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Size: 4
Size: 4 Binding: STB_GLOBAL
- Name: D0 - Name: D0
Type: STT_OBJECT Type: STT_OBJECT
Section: .data Section: .data
Size: 4 Size: 4
Binding: STB_GLOBAL
... ...

View File

@ -25,12 +25,12 @@ Sections:
Flags: [SHF_EXECINSTR, SHF_ALLOC] Flags: [SHF_EXECINSTR, SHF_ALLOC]
Symbols: Symbols:
Global: - Name: T1
- Name: T1 Section: .text
Section: .text Type: STT_FUNC
Type: STT_FUNC Value: 0x0
Value: 0x0 Size: 8
Size: 8 Binding: STB_GLOBAL
--- !ELF --- !ELF
FileHeader: !FileHeader FileHeader: !FileHeader
@ -47,10 +47,10 @@ Sections:
Flags: [SHF_EXECINSTR, SHF_ALLOC] Flags: [SHF_EXECINSTR, SHF_ALLOC]
Symbols: Symbols:
Global: - Name: T2
- Name: T2 Section: .text
Section: .text Type: STT_FUNC
Type: STT_FUNC Value: 0x0
Value: 0x0 Size: 4
Size: 4 Binding: STB_GLOBAL
... ...

View File

@ -36,25 +36,24 @@ Sections:
Type: SHT_ARM_ATTRIBUTES Type: SHT_ARM_ATTRIBUTES
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: 4115000000616561626900010B000000060208010901 Content: 4115000000616561626900010B000000060208010901
Symbols: Symbols:
Local: - Name: .text
- Name: .text Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Name: .data
- Name: .data Type: STT_SECTION
Type: STT_SECTION Section: .data
Section: .data - Name: .bss
- Name: .bss Type: STT_SECTION
Type: STT_SECTION Section: .bss
Section: .bss - Name: '$a'
- Name: '$a' Section: .text
Section: .text - Name: call_weak_fn
- Name: call_weak_fn Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text - Name: .ARM.attributes
- Name: .ARM.attributes Type: STT_SECTION
Type: STT_SECTION Section: .ARM.attributes
Section: .ARM.attributes
# CHECK: Section { # CHECK: Section {
# CHECK-NEXT: Index: 0 # CHECK-NEXT: Index: 0

View File

@ -49,17 +49,17 @@ Sections:
Type: R_MIPS_LO16 Type: R_MIPS_LO16
Symbols: Symbols:
Local: - Name: loc1
- Name: loc1 - Name: loc2
- Name: loc2 - Name: glob1
Global: Section: .text
- Name: glob1 Value: 0x0
Section: .text Size: 4
Value: 0x0 Binding: STB_GLOBAL
Size: 4 - Name: glob2
- Name: glob2 Binding: STB_GLOBAL
Weak: - Name: weak1
- Name: weak1 Binding: STB_WEAK
# CHECK: Section { # CHECK: Section {
# CHECK-NEXT: Index: 0 # CHECK-NEXT: Index: 0

View File

@ -11,18 +11,17 @@ Sections:
Flags: [ SHF_ALLOC, SHF_WRITE ] Flags: [ SHF_ALLOC, SHF_WRITE ]
Content: "DEADBEEF" Content: "DEADBEEF"
Symbols: Symbols:
Local: - Name: local_symbol
- Name: local_symbol Type: STT_OBJECT
Type: STT_OBJECT Section: .data
Section: .data - Name: global_symbol
Global: Type: STT_OBJECT
- Name: global_symbol Section: .data
Type: STT_OBJECT Binding: STB_GLOBAL
Section: .data - Name: weak_symbol
Weak: Type: STT_OBJECT
- Name: weak_symbol Section: .data
Type: STT_OBJECT Binding: STB_WEAK
Section: .data
# CHECK: Symbol { # CHECK: Symbol {
# CHECK: Name: (0) # CHECK: Name: (0)

View File

@ -18,13 +18,14 @@ Sections:
# when linked and run on x86_64, will go into an # when linked and run on x86_64, will go into an
# infloop. # infloop.
Symbols: Symbols:
Global: - Name: main
- Name: main Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1
Value: 0x1 Size: 2
Size: 2 Binding: STB_GLOBAL
- Name: undefined_symbol - Name: undefined_symbol
Binding: STB_GLOBAL
# CHECK: Symbols [ # CHECK: Symbols [
# CHECK-NEXT: Symbol { # CHECK-NEXT: Symbol {

View File

@ -57,35 +57,39 @@
# OBJ-NEXT: } # OBJ-NEXT: }
# YAML: Symbols: # YAML: Symbols:
# YAML-NEXT: Global: # YAML-NEXT: - Name: default1
# YAML-NEXT: - Name: default1 # YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Type: STT_OBJECT # YAML-NEXT: Section: .data
# YAML-NEXT: Section: .data # YAML-NEXT: Binding: STB_GLOBAL
# YAML-NEXT: Size: 0x0000000000000004 # YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: - Name: default2 # YAML-NEXT: - Name: default2
# YAML-NEXT: Type: STT_OBJECT # YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Section: .data # YAML-NEXT: Section: .data
# YAML-NEXT: Value: 0x0000000000000004 # YAML-NEXT: Binding: STB_GLOBAL
# YAML-NEXT: Size: 0x0000000000000004 # YAML-NEXT: Value: 0x0000000000000004
# YAML-NEXT: - Name: internal # YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: Type: STT_OBJECT # YAML-NEXT: - Name: internal
# YAML-NEXT: Section: .data # YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Value: 0x0000000000000008 # YAML-NEXT: Section: .data
# YAML-NEXT: Size: 0x0000000000000004 # YAML-NEXT: Binding: STB_GLOBAL
# YAML-NEXT: Visibility: STV_INTERNAL # YAML-NEXT: Value: 0x0000000000000008
# YAML-NEXT: - Name: hidden # YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: Type: STT_OBJECT # YAML-NEXT: Visibility: STV_INTERNAL
# YAML-NEXT: Section: .data # YAML-NEXT: - Name: hidden
# YAML-NEXT: Value: 0x000000000000000C # YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Size: 0x0000000000000004 # YAML-NEXT: Section: .data
# YAML-NEXT: Visibility: STV_HIDDEN # YAML-NEXT: Binding: STB_GLOBAL
# YAML-NEXT: - Name: protected # YAML-NEXT: Value: 0x000000000000000C
# YAML-NEXT: Type: STT_OBJECT # YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: Section: .data # YAML-NEXT: Visibility: STV_HIDDEN
# YAML-NEXT: Value: 0x0000000000000010 # YAML-NEXT: - Name: protected
# YAML-NEXT: Size: 0x0000000000000004 # YAML-NEXT: Type: STT_OBJECT
# YAML-NEXT: Visibility: STV_PROTECTED # YAML-NEXT: Section: .data
# YAML-NEXT: Other: [ STO_MIPS_PIC, STO_MIPS_MICROMIPS ] # YAML-NEXT: Binding: STB_GLOBAL
# YAML-NEXT: Value: 0x0000000000000010
# YAML-NEXT: Size: 0x0000000000000004
# YAML-NEXT: Visibility: STV_PROTECTED
# YAML-NEXT: Other: [ STO_MIPS_PIC, STO_MIPS_MICROMIPS ]
--- !ELF --- !ELF
FileHeader: FileHeader:
@ -103,34 +107,38 @@ Sections:
Size: 0x14 Size: 0x14
Symbols: Symbols:
Global: - Name: default1
- Name: default1 Type: STT_OBJECT
Type: STT_OBJECT Visibility: STV_DEFAULT
Visibility: STV_DEFAULT Section: .data
Section: .data Value: 0x00
Value: 0x00 Size: 0x04
Size: 0x04 Binding: STB_GLOBAL
- Name: default2 - Name: default2
Type: STT_OBJECT Type: STT_OBJECT
Section: .data Section: .data
Value: 0x04 Value: 0x04
Size: 0x04 Size: 0x04
- Name: internal Binding: STB_GLOBAL
Type: STT_OBJECT - Name: internal
Visibility: STV_INTERNAL Type: STT_OBJECT
Section: .data Visibility: STV_INTERNAL
Value: 0x08 Section: .data
Size: 0x04 Value: 0x08
- Name: hidden Size: 0x04
Type: STT_OBJECT Binding: STB_GLOBAL
Visibility: STV_HIDDEN - Name: hidden
Section: .data Type: STT_OBJECT
Value: 0x0C Visibility: STV_HIDDEN
Size: 0x04 Section: .data
- Name: protected Value: 0x0C
Type: STT_OBJECT Size: 0x04
Visibility: STV_PROTECTED Binding: STB_GLOBAL
Other: [ STO_MIPS_MICROMIPS, STO_MIPS_PIC ] - Name: protected
Section: .data Type: STT_OBJECT
Value: 0x10 Visibility: STV_PROTECTED
Size: 0x04 Other: [ STO_MIPS_MICROMIPS, STO_MIPS_PIC ]
Section: .data
Value: 0x10
Size: 0x04
Binding: STB_GLOBAL

View File

@ -20,11 +20,10 @@ Sections:
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: '' Content: ''
Symbols: Symbols:
Global: - Name: '-'
- Name: lib1 Type: STT_FILE
Index: SHN_ABS - Name: lib1
Value: 0x1234 Index: SHN_ABS
Local: Value: 0x1234
- Name: '-' Binding: STB_GLOBAL
Type: STT_FILE
... ...

View File

@ -20,11 +20,10 @@ Sections:
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: '' Content: ''
Symbols: Symbols:
Global: - Name: '-'
- Name: lib2 Type: STT_FILE
Index: SHN_ABS - Name: lib2
Value: 0x1234 Index: SHN_ABS
Local: Value: 0x1234
- Name: '-' Binding: STB_GLOBAL
Type: STT_FILE
... ...

View File

@ -20,11 +20,10 @@ Sections:
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: '' Content: ''
Symbols: Symbols:
Global: - Name: '-'
- Name: lib3 Type: STT_FILE
Index: SHN_ABS - Name: lib3
Value: 0x1234 Index: SHN_ABS
Local: Value: 0x1234
- Name: '-' Binding: STB_GLOBAL
Type: STT_FILE
... ...

View File

@ -20,7 +20,6 @@ Sections:
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: '' Content: ''
Symbols: Symbols:
Local: - Name: '-'
- Name: '-' Type: STT_FILE
Type: STT_FILE
... ...

View File

@ -44,15 +44,18 @@ Sections:
Flags: [ SHF_GROUP ] Flags: [ SHF_GROUP ]
Content: '00' Content: '00'
Symbols: Symbols:
Global: - Name: .debug_foo
- Name: .debug_foo Type: STT_SECTION
Type: STT_SECTION Section: .debug_foo
Section: .debug_foo Binding: STB_GLOBAL
- Name: .notdebug_foo - Name: .notdebug_foo
Type: STT_SECTION Type: STT_SECTION
Section: .notdebug_foo Section: .notdebug_foo
- Name: .Linfo_string0 Binding: STB_GLOBAL
Section: .debug_bar - Name: .Linfo_string0
- Name: groupname Section: .debug_bar
Section: .group Binding: STB_GLOBAL
- Name: groupname
Section: .group
Binding: STB_GLOBAL
... ...

View File

@ -9,10 +9,10 @@ FileHeader:
Type: ET_EXEC Type: ET_EXEC
Machine: EM_X86_64 Machine: EM_X86_64
Symbols: Symbols:
Global: - Name: test
- Name: test Index: SHN_ABS
Index: SHN_ABS Value: 0x1234
Value: 0x1234 Binding: STB_GLOBAL
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -36,13 +36,12 @@ Sections:
AddressAlign: 0x0000000000000004 AddressAlign: 0x0000000000000004
Content: '' Content: ''
Symbols: Symbols:
Local: - Name: .text.bar
- Name: .text.bar Type: STT_SECTION
Type: STT_SECTION Section: .text.bar
Section: .text.bar - Name: .text.foo
- Name: .text.foo Type: STT_SECTION
Type: STT_SECTION Section: .text.foo
Section: .text.foo - Name: .ARM.exidx.text.foo
- Name: .ARM.exidx.text.foo Type: STT_SECTION
Type: STT_SECTION Section: .ARM.exidx.text.foo
Section: .ARM.exidx.text.foo

View File

@ -47,11 +47,11 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "00000000" Content: "00000000"
Symbols: Symbols:
Global: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1004
Value: 0x1004 Binding: STB_GLOBAL
# CHECK: Type: SHT_NULL # CHECK: Type: SHT_NULL

View File

@ -56,24 +56,28 @@ Sections:
Type: R_X86_64_PC32 Type: R_X86_64_PC32
Addend: 0x13 Addend: 0x13
Symbols: Symbols:
Global: - Name: _start
- Name: _start Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 4
Size: 4 Binding: STB_GLOBAL
- Name: foo - Name: foo
Type: STT_FUNC Type: STT_FUNC
Size: 4 Size: 4
- Name: fooA Binding: STB_GLOBAL
Type: STT_FUNC - Name: fooA
Size: 4 Type: STT_FUNC
- Name: bar Size: 4
Type: STT_OBJECT Binding: STB_GLOBAL
Size: 4 - Name: bar
- Name: barA Type: STT_OBJECT
Type: STT_OBJECT Size: 4
Size: 4 Binding: STB_GLOBAL
- Name: barA
Type: STT_OBJECT
Size: 4
Binding: STB_GLOBAL
# CHECK: Relocations [ # CHECK: Relocations [
# CHECK-NEXT: Section (2) .rel.text { # CHECK-NEXT: Section (2) .rel.text {

View File

@ -9,22 +9,26 @@ FileHeader:
Type: ET_EXEC Type: ET_EXEC
Machine: EM_HEXAGON Machine: EM_HEXAGON
Symbols: Symbols:
Global: - Name: test
- Name: test Index: SHN_COMMON
Index: SHN_COMMON Value: 0x1234
Value: 0x1234 Binding: STB_GLOBAL
- Name: test2 - Name: test2
Index: SHN_HEXAGON_SCOMMON Index: SHN_HEXAGON_SCOMMON
Value: 0x1235 Value: 0x1235
- Name: test3 Binding: STB_GLOBAL
Index: SHN_HEXAGON_SCOMMON_2 - Name: test3
Value: 0x1236 Index: SHN_HEXAGON_SCOMMON_2
- Name: test4 Value: 0x1236
Index: SHN_HEXAGON_SCOMMON_4 Binding: STB_GLOBAL
Value: 0x1237 - Name: test4
- Name: test5 Index: SHN_HEXAGON_SCOMMON_4
Index: SHN_HEXAGON_SCOMMON_8 Value: 0x1237
Value: 0x1238 Binding: STB_GLOBAL
- Name: test5
Index: SHN_HEXAGON_SCOMMON_8
Value: 0x1238
Binding: STB_GLOBAL
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -53,15 +53,16 @@ Sections:
Type: SHT_PROGBITS Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ] Flags: [ SHF_ALLOC ]
Symbols: Symbols:
Global: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1234
Value: 0x1234 Binding: STB_GLOBAL
- Name: bar - Name: bar
Type: STT_OBJECT Type: STT_OBJECT
Section: .data Section: .data
Value: 0xabcd Value: 0xabcd
Binding: STB_GLOBAL
# CHECK: Format: # CHECK: Format:
# 32-SAME: ELF32- # 32-SAME: ELF32-

View File

@ -22,16 +22,17 @@ Sections:
Content: DEADBEEF Content: DEADBEEF
Size: 16 Size: 16
Symbols: Symbols:
Global: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 16
Value: 16 Size: 8
Size: 8 Binding: STB_GLOBAL
- Name: bar - Name: bar
Type: STT_OBJECT Type: STT_OBJECT
Section: .data Section: .data
Size: 16 Size: 16
Binding: STB_GLOBAL
# CHECK: Sections [ # CHECK: Sections [
# CHECK-NEXT: Section { # CHECK-NEXT: Section {

View File

@ -33,29 +33,28 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: Local
- Name: Local Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: LocalSection
- Name: LocalSection Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Name: LocalFile
- Name: LocalFile Type: STT_FILE
Type: STT_FILE - Name: Global
Weak: Type: STT_FUNC
- Name: Weak Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1010
Section: .text Binding: STB_GLOBAL
Value: 0x1008 - Name: Weak
Global: Type: STT_FUNC
- Name: Global Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1008
Section: .text Binding: STB_WEAK
Value: 0x1010
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -19,9 +19,8 @@ Sections:
Symbol: .L.rel Symbol: .L.rel
Type: R_X86_64_PC32 Type: R_X86_64_PC32
Symbols: Symbols:
Local: - Name: .L.rel
- Name: .L.rel Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text
# CHECK: not stripping symbol '.L.rel' because it is named in a relocation. # CHECK: not stripping symbol '.L.rel' because it is named in a relocation.

View File

@ -32,27 +32,26 @@ Sections:
- Name: .LLVM.Custom.Section - Name: .LLVM.Custom.Section
Type: SHT_PROGBITS Type: SHT_PROGBITS
Symbols: Symbols:
Local: - Name: Local
- Name: Local Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text - Name: .L.LocalSection
- Name: .L.LocalSection Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Type: STT_SECTION
- Type: STT_SECTION Section: .LLVM.Custom.Section
Section: .LLVM.Custom.Section - Name: .L.LocalFile
- Name: .L.LocalFile Type: STT_FILE
Type: STT_FILE - Name: .L.str
- Name: .L.str Type: STT_OBJECT
Type: STT_OBJECT Section: .text
Section: .text - Name: .L.undefined
- Name: .L.undefined - Name: .L.abs
- Name: .L.abs Index: SHN_ABS
Index: SHN_ABS - Name: .L.Global
Global: Type: STT_FUNC
- Name: .L.Global Section: .text
Type: STT_FUNC Binding: STB_GLOBAL
Section: .text
# CHECK: Symbols [ # CHECK: Symbols [
# CHECK-NEXT: Symbol { # CHECK-NEXT: Symbol {

View File

@ -55,17 +55,16 @@ Sections:
- Name: .text - Name: .text
Type: SHT_PROGBITS Type: SHT_PROGBITS
Symbols: Symbols:
Local: - Name: Local
- Name: Local Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text - Name: .L.str
- Name: .L.str Type: STT_OBJECT
Type: STT_OBJECT Section: .text
Section: .text - Name: Global
Global: Type: STT_FUNC
- Name: Global Section: .text
Type: STT_FUNC Binding: STB_GLOBAL
Section: .text
# CHECK: Symbols [ # CHECK: Symbols [
# CHECK-NEXT: Symbol { # CHECK-NEXT: Symbol {

View File

@ -31,25 +31,25 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: Local
- Name: Local Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: Global
Weak: Type: STT_FUNC
- Name: Weak Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1010
Section: .text Binding: STB_GLOBAL
Value: 0x1008 - Name: Weak
- Name: WeakUndef Type: STT_FUNC
Global: Size: 8
- Name: Global Section: .text
Type: STT_FUNC Value: 0x1008
Size: 8 Binding: STB_WEAK
Section: .text - Name: WeakUndef
Value: 0x1010 Binding: STB_WEAK
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -33,6 +33,5 @@ Sections:
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ] Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Symbols: Symbols:
Local: - Name: foo
- Name: foo Section: .group
Section: .group

View File

@ -38,19 +38,19 @@ Sections:
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ] Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Symbols: Symbols:
Local: - Name: .text.bar
- Name: .text.bar Type: STT_SECTION
Type: STT_SECTION Section: .text.bar
Section: .text.bar - Name: .text.foo
- Name: .text.foo Type: STT_SECTION
Type: STT_SECTION Section: .text.foo
Section: .text.foo - Name: bar
Weak: Type: STT_FUNC
- Name: bar Section: .text.bar
Type: STT_FUNC Size: 0x0000000000000000
Section: .text.bar Binding: STB_WEAK
Size: 0x0000000000000000 - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text.foo
Section: .text.foo Size: 0x0000000000000000
Size: 0x0000000000000000 Binding: STB_WEAK

View File

@ -38,19 +38,19 @@ Sections:
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Symbols: Symbols:
Local: - Name: .text.foo
- Name: .text.foo Type: STT_SECTION
Type: STT_SECTION Section: .text.foo
Section: .text.foo - Name: .text.bar
- Name: .text.bar Type: STT_SECTION
Type: STT_SECTION Section: .text.bar
Section: .text.bar - Name: foo
Weak: Type: STT_FUNC
- Name: foo Section: .text.foo
Type: STT_FUNC Size: 0x0000000000000000
Section: .text.foo Binding: STB_WEAK
Size: 0x0000000000000000 - Name: bar
- Name: bar Type: STT_FUNC
Type: STT_FUNC Section: .text.bar
Section: .text.bar Size: 0x0000000000000000
Size: 0x0000000000000000 Binding: STB_WEAK

View File

@ -38,19 +38,19 @@ Sections:
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ] Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Symbols: Symbols:
Local: - Name: .text.bar
- Name: .text.bar Type: STT_SECTION
Type: STT_SECTION Section: .text.bar
Section: .text.bar - Name: .text.foo
- Name: .text.foo Type: STT_SECTION
Type: STT_SECTION Section: .text.foo
Section: .text.foo - Name: bar
Weak: Type: STT_FUNC
- Name: bar Section: .text.bar
Type: STT_FUNC Size: 0x0000000000000000
Section: .text.bar Binding: STB_WEAK
Size: 0x0000000000000000 - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text.foo
Section: .text.foo Size: 0x0000000000000000
Size: 0x0000000000000000 Binding: STB_WEAK

View File

@ -8,8 +8,8 @@ FileHeader:
Type: ET_EXEC Type: ET_EXEC
Machine: EM_X86_64 Machine: EM_X86_64
Symbols: Symbols:
Global: - Name: test
- Name: test Index: SHN_HEXAGON_SCOMMON
Index: SHN_HEXAGON_SCOMMON Binding: STB_GLOBAL
# CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65280 # CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65280

View File

@ -23,14 +23,13 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_FILE
Type: STT_FILE Section: .text
Section: .text - Name: bar
Global: Type: STT_FUNC
- Name: bar Section: .text
Type: STT_FUNC Binding: STB_GLOBAL
Section: .text
#STRIPALL: Symbols [ #STRIPALL: Symbols [
#STRIPALL-NEXT: Symbol { #STRIPALL-NEXT: Symbol {

View File

@ -24,21 +24,22 @@ Sections:
Type: SHT_PROGBITS Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Symbols: Symbols:
Local: - Name: Local1
- Name: Local1 Section: .text
Section: .text - Name: Local2
- Name: Local2 Section: .text
Section: .text - Name: Global1
Weak: Section: .text
- Name: Weak1 Binding: STB_GLOBAL
Section: .text - Name: Global2
- Name: Weak2 Section: .text
Section: .text Binding: STB_GLOBAL
Global: - Name: Weak1
- Name: Global1 Section: .text
Section: .text Binding: STB_WEAK
- Name: Global2 - Name: Weak2
Section: .text Section: .text
Binding: STB_WEAK
# CHECK: Symbol table '.symtab' contains 7 entries: # CHECK: Symbol table '.symtab' contains 7 entries:
# CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name # CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name

View File

@ -56,34 +56,42 @@ Sections:
Type: SHT_PROGBITS Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Symbols: Symbols:
Local: - Name: Local1
- Name: Local1 Section: .text
Section: .text - Name: Local2
- Name: Local2 Section: .text
Section: .text - Name: Global1
Weak: Section: .text
- Name: Weak1 Binding: STB_GLOBAL
Section: .text - Name: Global2
- Name: Weak2 Section: .text
Section: .text Binding: STB_GLOBAL
- Name: Weak3 - Name: Global3
Section: .text Section: .text
Global: Binding: STB_GLOBAL
- Name: Global1 - Name: Global4
Section: .text Section: .text
- Name: Global2 Binding: STB_GLOBAL
Section: .text - Name: Global5
- Name: Global3 Section: .text
Section: .text Binding: STB_GLOBAL
- Name: Global4 - Name: Global6
Section: .text Section: .text
- Name: Global5 Binding: STB_GLOBAL
Section: .text - Name: "Global5 Global6"
- Name: Global6 Section: .text
Section: .text Binding: STB_GLOBAL
- Name: "Global5 Global6" - Name: Global7
Section: .text Binding: STB_GLOBAL
- Name: Global7 - Name: Weak1
Section: .text
Binding: STB_WEAK
- Name: Weak2
Section: .text
Binding: STB_WEAK
- Name: Weak3
Section: .text
Binding: STB_WEAK
# CHECK: Symbol table '.symtab' contains 14 entries: # CHECK: Symbol table '.symtab' contains 14 entries:
# CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name # CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name

View File

@ -16,12 +16,11 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -27,22 +27,21 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: bar
- Name: bar Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1008
Value: 0x1008 Size: 8
Size: 8 - Name: baz
- Name: baz Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1010
Value: 0x1010 Size: 8
Size: 8
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -29,53 +29,57 @@ Sections:
Symbol: undefGlobal Symbol: undefGlobal
Type: R_X86_64_PC32 Type: R_X86_64_PC32
Symbols: Symbols:
Local: - Name: hiddenLocal
- Name: hiddenLocal Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1008
Value: 0x1008 Size: 8
Size: 8 Visibility: STV_HIDDEN
Visibility: STV_HIDDEN - Name: defaultGlobal
Weak: Type: STT_FUNC
- Name: hiddenWeak Size: 8
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1010 Binding: STB_GLOBAL
Size: 8 - Name: hiddenGlobal
Visibility: STV_HIDDEN Type: STT_OBJECT
Global: Section: .data
- Name: defaultGlobal Value: 0x2006
Type: STT_FUNC Size: 2
Size: 8 Visibility: STV_HIDDEN
Section: .text Binding: STB_GLOBAL
Value: 0x1000 - Name: hiddenGlobalCommon
- Name: hiddenGlobal Type: STT_OBJECT
Type: STT_OBJECT Index: SHN_COMMON
Section: .data Value: 0x2006
Value: 0x2006 Size: 2
Size: 2 Visibility: STV_HIDDEN
Visibility: STV_HIDDEN Binding: STB_GLOBAL
- Name: hiddenGlobalCommon - Name: undefGlobal
Type: STT_OBJECT Type: STT_FUNC
Index: SHN_COMMON Size: 8
Value: 0x2006 Binding: STB_GLOBAL
Size: 2 - Name: internalGlobal
Visibility: STV_HIDDEN Type: STT_OBJECT
- Name: undefGlobal Section: .data
Type: STT_FUNC Value: 0x2002
Size: 8 Size: 2
- Name: internalGlobal Visibility: STV_INTERNAL
Type: STT_OBJECT Binding: STB_GLOBAL
Section: .data - Name: protectedGlobal
Value: 0x2002 Type: STT_OBJECT
Size: 2 Section: .data
Visibility: STV_INTERNAL Value: 0x2000
- Name: protectedGlobal Size: 4
Type: STT_OBJECT Visibility: STV_PROTECTED
Section: .data Binding: STB_GLOBAL
Value: 0x2000 - Name: hiddenWeak
Size: 4 Type: STT_FUNC
Visibility: STV_PROTECTED Section: .text
Value: 0x1010
Size: 8
Visibility: STV_HIDDEN
Binding: STB_WEAK
#CHECK: Relocations [ #CHECK: Relocations [
#CHECK-NEXT: Section (3) .rel.text { #CHECK-NEXT: Section (3) .rel.text {

View File

@ -42,31 +42,32 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "0000000000000000" Content: "0000000000000000"
Symbols: Symbols:
Local: - Name: Local
- Name: Local Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: Global
Weak: Type: STT_FUNC
- Name: Weak Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1010
Section: .text Binding: STB_GLOBAL
Value: 0x1008 - Name: GlobalUndef
Global: Type: STT_FUNC
- Name: Global Binding: STB_GLOBAL
Type: STT_FUNC - Name: GlobalCommon
Size: 8 Type: STT_OBJECT
Section: .text Index: SHN_COMMON
Value: 0x1010 Value: 0x2006
- Name: GlobalUndef Size: 2
Type: STT_FUNC Binding: STB_GLOBAL
- Name: GlobalCommon - Name: Weak
Type: STT_OBJECT Type: STT_FUNC
Index: SHN_COMMON Size: 8
Value: 0x2006 Section: .text
Size: 2 Value: 0x1008
Binding: STB_WEAK
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -18,17 +18,16 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text - Name: bar
- Name: bar Type: STT_FILE
Type: STT_FILE Section: .text
Section: .text - Name: foobar
Global: Type: STT_FUNC
- Name: foobar Section: .text
Type: STT_FUNC Binding: STB_GLOBAL
Section: .text
# COMMON: Symbols [ # COMMON: Symbols [
# COMMON-NEXT: Symbol { # COMMON-NEXT: Symbol {

View File

@ -33,20 +33,22 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "0000000000000000" Content: "0000000000000000"
Symbols: Symbols:
Global: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1004
Value: 0x1004 Binding: STB_GLOBAL
- Name: bar - Name: bar
Type: STT_OBJECT Type: STT_OBJECT
Section: .data Section: .data
Value: 0x2000 Value: 0x2000
Size: 4 Size: 4
- Name: empty Binding: STB_GLOBAL
Type: STT_FUNC - Name: empty
Section: .text Type: STT_FUNC
Value: 0x1008 Section: .text
Value: 0x1008
Binding: STB_GLOBAL
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -30,22 +30,21 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: foobaz
- Name: foobaz Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: bar
- Name: bar Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1008
Value: 0x1008 Size: 8
Size: 8 - Name: rebar
- Name: rebar Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1010
Value: 0x1010 Size: 8
Size: 8
#REGEX1-NOT: foobaz #REGEX1-NOT: foobaz
#REGEX1-NOT: bar #REGEX1-NOT: bar

View File

@ -24,9 +24,9 @@ Sections:
Type: R_X86_64_PC32 Type: R_X86_64_PC32
Symbols: Symbols:
Global: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Size: 4
Size: 4 Binding: STB_GLOBAL
# CHECK: Symbol table .symtab cannot be removed because it is referenced by the relocation section .rel.text. # CHECK: Symbol table .symtab cannot be removed because it is referenced by the relocation section .rel.text.

View File

@ -16,17 +16,18 @@ Sections:
Type: SHT_PROGBITS Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ] Flags: [ SHF_ALLOC ]
Symbols: Symbols:
Global: - Name: test
- Name: test Type: STT_FUNC
Type: STT_FUNC Section: .test
Section: .test Value: 0x1000
Value: 0x1000 Size: 4
Size: 4 Binding: STB_GLOBAL
- Name: test2 - Name: test2
Type: STT_FUNC Type: STT_FUNC
Section: .test2 Section: .test2
Value: 0x1000 Value: 0x1000
Size: 4 Size: 4
Binding: STB_GLOBAL
# The sections counted here should be .test, .symtab, .strtab, and .shstrtab. # The sections counted here should be .test, .symtab, .strtab, and .shstrtab.
# The 5th section is the null section. # The 5th section is the null section.

View File

@ -51,7 +51,6 @@ Sections:
SHF_OS_NONCONFORMING, SHF_STRINGS, SHF_TLS, SHF_WRITE ] SHF_OS_NONCONFORMING, SHF_STRINGS, SHF_TLS, SHF_WRITE ]
Content: "a4a4a4a4" Content: "a4a4a4a4"
Symbols: Symbols:
Local:
- Name: dummy - Name: dummy
Section: .group Section: .group

View File

@ -8,8 +8,8 @@ FileHeader:
Type: ET_EXEC Type: ET_EXEC
Machine: EM_X86_64 Machine: EM_X86_64
Symbols: Symbols:
Global: - Name: test
- Name: test Index: 0xff05
Index: 0xff05 Binding: STB_GLOBAL
# CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65285 # CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65285

View File

@ -32,22 +32,21 @@ Sections:
- Name: .debug_bar - Name: .debug_bar
Type: SHT_PROGBITS Type: SHT_PROGBITS
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: bar
- Name: bar Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1008
Value: 0x1008 Size: 8
Size: 8 - Name: baz
- Name: baz Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1010
Value: 0x1010 Size: 8
Size: 8
# CHECK: Name: .text # CHECK: Name: .text
# CHECK: Name: .gnu.warning.foo # CHECK: Name: .gnu.warning.foo

View File

@ -28,14 +28,16 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "00000000" Content: "00000000"
Symbols: Symbols:
Global: - Name: debugfoo
- Name: debugfoo Section: .debug_foo
Section: .debug_foo Binding: STB_GLOBAL
- Name: foo - Name: foo
Section: .text Section: .text
- Name: bar Binding: STB_GLOBAL
Section: .text.bar - Name: bar
Section: .text.bar
Binding: STB_GLOBAL
# CHECK: SectionHeaderCount: 3 # CHECK: SectionHeaderCount: 3
# CHECK: Name: .text # CHECK: Name: .text

View File

@ -28,14 +28,16 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "00000000" Content: "00000000"
Symbols: Symbols:
Global: - Name: debugfoo
- Name: debugfoo Section: .debug_foo
Section: .debug_foo Binding: STB_GLOBAL
- Name: foo - Name: foo
Section: .text Section: .text
- Name: bar Binding: STB_GLOBAL
Section: .text.bar - Name: bar
Section: .text.bar
Binding: STB_GLOBAL
# CHECK: SectionHeaderCount: 5 # CHECK: SectionHeaderCount: 5
# CHECK: Name: .text # CHECK: Name: .text

View File

@ -110,11 +110,12 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "00000000" Content: "00000000"
Symbols: Symbols:
Global: - Name: foo
- Name: foo Section: .text
Section: .text Binding: STB_GLOBAL
- Name: debugfoo - Name: debugfoo
Section: .debugfoo Section: .debugfoo
Binding: STB_GLOBAL
# CHECK: SectionHeaderCount: 5 # CHECK: SectionHeaderCount: 5

View File

@ -23,9 +23,9 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Weak: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Binding: STB_WEAK
#CHECK: Symbol foo cannot be removed because it is referenced by the section .group[1]. #CHECK: Symbol foo cannot be removed because it is referenced by the section .group[1].

View File

@ -39,17 +39,16 @@ Sections:
Type: SHT_PROGBITS Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1234
Value: 0x1234 Size: 8
Size: 8 - Name: bar
- Name: bar Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x5678
Value: 0x5678 Size: 8
Size: 8
# CHECK: Symbols [ # CHECK: Symbols [
# CHECK-NEXT: Symbol { # CHECK-NEXT: Symbol {

View File

@ -22,11 +22,10 @@ Sections:
Symbol: foo Symbol: foo
Type: R_X86_64_PC32 Type: R_X86_64_PC32
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8
#CHECK: not stripping symbol 'foo' because it is named in a relocation. #CHECK: not stripping symbol 'foo' because it is named in a relocation.

View File

@ -43,9 +43,7 @@ Sections:
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: '0102' Content: '0102'
Symbols: Symbols:
Local: - Name: foo
- Name: foo Section: .data
Section: .data Value: 0x0000000000000001
Value: 0x0000000000000001
DynamicSymbols: {}
... ...

View File

@ -43,6 +43,6 @@ Sections:
Symbol: bar Symbol: bar
Type: R_X86_64_32S Type: R_X86_64_32S
Symbols: Symbols:
Global: - Name: bar
- Name: bar Section: .text
Section: .text Binding: STB_GLOBAL

View File

@ -28,24 +28,23 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: bar
Weak: Type: STT_FUNC
- Name: bar Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1008
Section: .text Binding: STB_WEAK
Value: 0x1008 - Name: baz
Global: Type: STT_FUNC
- Name: baz Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1010
Section: .text Binding: STB_GLOBAL
Value: 0x1010
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -57,42 +57,43 @@ Sections:
Symbol: foo Symbol: foo
Type: R_X86_64_PC32 Type: R_X86_64_PC32
Symbols: Symbols:
Local: - Name: foo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: bar
- Name: bar Type: STT_FUNC
Type: STT_FUNC Size: 8
Size: 8 Section: .text
Section: .text Value: 0x1008
Value: 0x1008 - Name: barfoo
- Name: barfoo Type: STT_FUNC
Type: STT_FUNC Size: 8
Size: 8 Section: .text
Section: .text Value: 0x1010
Value: 0x1010 - Name: fileSymbol
- Name: fileSymbol Type: STT_FILE
Type: STT_FILE - Name: sectionSymbol
- Name: sectionSymbol Type: STT_SECTION
Type: STT_SECTION - Name: foobar
Weak: Type: STT_FUNC
- Name: baz Binding: STB_GLOBAL
Type: STT_FUNC - Name: barbaz
Size: 8 Type: STT_FUNC
Section: .text Size: 8
Value: 0x1018 Section: .text
- Name: foobaz Value: 0x1020
Type: STT_FUNC Binding: STB_GLOBAL
Global: - Name: baz
- Name: foobar Type: STT_FUNC
Type: STT_FUNC Size: 8
- Name: barbaz Section: .text
Type: STT_FUNC Value: 0x1018
Size: 8 Binding: STB_WEAK
Section: .text - Name: foobaz
Value: 0x1020 Type: STT_FUNC
Binding: STB_WEAK
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -22,38 +22,43 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "0000000000000000" Content: "0000000000000000"
Symbols: Symbols:
Global: - Name: _start
- Name: _start Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 4
Size: 4 Binding: STB_GLOBAL
- Name: bam - Name: bam
Type: STT_FUNC Type: STT_FUNC
Section: .text Section: .text
Value: 0x1001 Value: 0x1001
Size: 4 Size: 4
Visibility: STV_HIDDEN Visibility: STV_HIDDEN
- Name: foo Binding: STB_GLOBAL
Type: STT_FUNC - Name: foo
Section: .text Type: STT_FUNC
Value: 0x1004 Section: .text
- Name: faz Value: 0x1004
Type: STT_OBJECT Binding: STB_GLOBAL
Section: .data - Name: faz
Value: 0x2002 Type: STT_OBJECT
Size: 2 Section: .data
Visibility: STV_INTERNAL Value: 0x2002
- Name: bar Size: 2
Type: STT_OBJECT Visibility: STV_INTERNAL
Section: .data Binding: STB_GLOBAL
Value: 0x2000 - Name: bar
Size: 4 Type: STT_OBJECT
- Name: baz Section: .data
Type: STT_OBJECT Value: 0x2000
Section: .data Size: 4
Value: 0x2004 Binding: STB_GLOBAL
Size: 4 - Name: baz
Type: STT_OBJECT
Section: .data
Value: 0x2004
Size: 4
Binding: STB_GLOBAL
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -37,11 +37,10 @@ Sections:
Type: SHT_PROGBITS Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Symbols: Symbols:
Local: - Name: ""
- Name: "" Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text # We need to have a named symbol, otherwise the original
Global: # issue that was fixed is not reproduced by this test.
# We need to have a named symbol, otherwise the original - Name: foo
# issue that was fixed is not reproduced by this test. Binding: STB_GLOBAL
- Name: foo

View File

@ -23,27 +23,27 @@ Sections:
Symbol: undefGlobal Symbol: undefGlobal
Type: R_X86_64_PC32 Type: R_X86_64_PC32
Symbols: Symbols:
Local: - Name: Local
- Name: Local Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1008
Value: 0x1008 Size: 8
Size: 8 - Name: Global
Weak: Type: STT_FUNC
- Name: Weak Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1018
Section: .text Binding: STB_GLOBAL
Value: 0x1010 - Name: undefGlobal
Global: Type: STT_FUNC
- Name: Global Size: 8
Type: STT_FUNC Binding: STB_GLOBAL
Size: 8 - Name: Weak
Section: .text Type: STT_FUNC
Value: 0x1018 Size: 8
- Name: undefGlobal Section: .text
Type: STT_FUNC Value: 0x1010
Size: 8 Binding: STB_WEAK
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -28,24 +28,23 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Size: 64 Size: 64
Symbols: Symbols:
Local: - Name: Local
- Name: Local Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1000
Value: 0x1000 Size: 8
Size: 8 - Name: Global
Weak: Type: STT_FUNC
- Name: Weak Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1010
Section: .text Binding: STB_GLOBAL
Value: 0x1008 - Name: Weak
Global: Type: STT_FUNC
- Name: Global Size: 8
Type: STT_FUNC Section: .text
Size: 8 Value: 0x1008
Section: .text Binding: STB_WEAK
Value: 0x1010
#CHECK: Symbols [ #CHECK: Symbols [
#CHECK-NEXT: Symbol { #CHECK-NEXT: Symbol {

View File

@ -33,41 +33,43 @@ Sections:
Flags: [ SHF_MERGE, SHF_STRINGS ] Flags: [ SHF_MERGE, SHF_STRINGS ]
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: 5562756E747520636C616E672076657273696F6E20332E352D317562756E74753120287472756E6B2920286261736564206F6E204C4C564D20332E352900 Content: 5562756E747520636C616E672076657273696F6E20332E352D317562756E74753120287472756E6B2920286261736564206F6E204C4C564D20332E352900
Symbols: Symbols:
Local: - Type: STT_SECTION
- Type: STT_SECTION Section: .text
Section: .text - Type: STT_SECTION
- Type: STT_SECTION Section: .anothertext
Section: .anothertext Value: 0x0000000000000010
Value: 0x0000000000000010 - Type: STT_SECTION
- Type: STT_SECTION Section: .eh_frame
Section: .eh_frame Value: 0x0000000000000050
Value: 0x0000000000000050 - Type: STT_SECTION
- Type: STT_SECTION Section: .data
Section: .data Value: 0x00000000000000A8
Value: 0x00000000000000A8 - Type: STT_SECTION
- Type: STT_SECTION Section: .comment
Section: .comment - Name: /tmp/a.c
- Name: /tmp/a.c Type: STT_FILE
Type: STT_FILE - Type: STT_FILE
- Type: STT_FILE - Name: somedata
Global: Type: STT_OBJECT
- Name: somedata Section: .anothertext
Type: STT_OBJECT Value: 0x0000000000000045
Section: .anothertext Binding: STB_GLOBAL
Value: 0x0000000000000045 - Name: main
- Name: main Type: STT_FUNC
Type: STT_FUNC Section: .anothertext
Section: .anothertext Value: 0x0000000000000010
Value: 0x0000000000000010 Size: 0x000000000000003F
Size: 0x000000000000003F Binding: STB_GLOBAL
- Name: foo - Name: foo
Type: STT_FUNC Type: STT_FUNC
Section: .text Section: .text
Size: 0x000000000000000D Size: 0x000000000000000D
- Name: a Binding: STB_GLOBAL
Type: STT_OBJECT - Name: a
Section: .data Type: STT_OBJECT
Value: 0x00000000000000A8 Section: .data
Size: 0x0000000000000004 Value: 0x00000000000000A8
Size: 0x0000000000000004
Binding: STB_GLOBAL
... ...

View File

@ -119,13 +119,12 @@ Sections:
Symbol: .text Symbol: .text
Type: R_X86_64_32 Type: R_X86_64_32
Symbols: Symbols:
Local: - Name: func
- Name: func Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x0000000000000001
Value: 0x0000000000000001 - Name: sym
- Name: sym Section: .text
Section: .text - Name: .text
- Name: .text Type: STT_SECTION
Type: STT_SECTION Section: .text
Section: .text

View File

@ -51,5 +51,5 @@ Sections:
Symbol: x Symbol: x
Type: R_X86_64_64 Type: R_X86_64_64
Symbols: Symbols:
Global: - Name: x
- Name: x Binding: STB_GLOBAL

View File

@ -23,15 +23,14 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "0000000000000000" Content: "0000000000000000"
Symbols: Symbols:
Local: - Name: _Z3fooi
- Name: _Z3fooi Type: STT_FUNC
Type: STT_FUNC Section: .text1
Section: .text1 Value: 0x1000
Value: 0x1000 - Name: _Z3foov
- Name: _Z3foov Type: STT_FUNC
Type: STT_FUNC Section: .text2
Section: .text2 Value: 0x1010
Value: 0x1010
# We just want to check that the symbols are demangled # We just want to check that the symbols are demangled
# DEMANGLE: foo(int) # DEMANGLE: foo(int)

View File

@ -63,13 +63,12 @@ Sections:
Type: R_X86_64_64 Type: R_X86_64_64
Symbols: Symbols:
Local: - Name: loc1
- Name: loc1 - Name: loc2
- Name: loc2 - Name: glob1
Global: Section: .text
- Name: glob1 Value: 0x0
Section: .text Size: 4
Value: 0x0 Binding: STB_GLOBAL
Size: 4 - Name: glob2
- Name: glob2 Binding: STB_GLOBAL

View File

@ -28,22 +28,22 @@ Sections:
AddressAlign: 0x0000000000000010 AddressAlign: 0x0000000000000010
Content: "00000000" Content: "00000000"
Symbols: Symbols:
Global: - Name: lfoo
- Name: foo Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x1004
Value: 0x1004 - Name: lbar
- Name: bar Type: STT_OBJECT
Type: STT_OBJECT Section: .text
Section: .text Value: 0x1008
Value: 0x1008 - Name: foo
Local: Type: STT_FUNC
- Name: lfoo Section: .text
Type: STT_FUNC Value: 0x1004
Section: .text Binding: STB_GLOBAL
Value: 0x1004 - Name: bar
- Name: lbar Type: STT_OBJECT
Type: STT_OBJECT Section: .text
Section: .text Value: 0x1008
Value: 0x1008 Binding: STB_GLOBAL

View File

@ -36,6 +36,6 @@ Sections:
- VERSION_1 - VERSION_1
- VERSION_2 - VERSION_2
DynamicSymbols: DynamicSymbols:
Global: - Name: bar
- Name: bar Binding: STB_GLOBAL
... ...

View File

@ -43,5 +43,5 @@ Sections:
Flags: 12 Flags: 12
Other: 2 Other: 2
DynamicSymbols: DynamicSymbols:
Global: - Name: f1
- Name: f1 Binding: STB_GLOBAL

View File

@ -46,5 +46,5 @@ Sections:
Flags: 12 Flags: 12
Other: 2 Other: 2
DynamicSymbols: DynamicSymbols:
Global: - Name: f1
- Name: f1 Binding: STB_GLOBAL

View File

@ -25,11 +25,11 @@ Sections:
AddressAlign: 8 AddressAlign: 8
Content: 1400000000000000017A5200017810011B0C070890010710140000001C000000B0F0FFFF2A00000000000000000000001400000000000000017A5200017810011B0C070890010000240000001C00000050F0FFFF20000000000E10460E184A0F0B770880003F1A3B2A332422000000001C000000440000003EF1FFFF1000000000410E108602430D064B0C07080000002C0000006400000038F1FFFF7F0C000000450C0A00491006027600450F0376780603660C0C0A00450C070800000000002C0000009400000088FDFFFF6600000000410E108602430D06428F03458E04478D058C06488307024B0C07080000000014000000C4000000C8FDFFFF01000000000000000000000000000000 Content: 1400000000000000017A5200017810011B0C070890010710140000001C000000B0F0FFFF2A00000000000000000000001400000000000000017A5200017810011B0C070890010000240000001C00000050F0FFFF20000000000E10460E184A0F0B770880003F1A3B2A332422000000001C000000440000003EF1FFFF1000000000410E108602430D064B0C07080000002C0000006400000038F1FFFF7F0C000000450C0A00491006027600450F0376780603660C0C0A00450C070800000000002C0000009400000088FDFFFF6600000000410E108602430D06428F03458E04478D058C06488307024B0C07080000000014000000C4000000C8FDFFFF01000000000000000000000000000000
Symbols: Symbols:
Global: - Name: myfunc
- Name: myfunc Type: STT_FUNC
Type: STT_FUNC Section: .text
Section: .text Value: 0x0000000000400000
Value: 0x0000000000400000 Binding: STB_GLOBAL
ProgramHeaders: ProgramHeaders:
- Type: PT_LOAD - Type: PT_LOAD
Flags: [ PF_X, PF_R ] Flags: [ PF_X, PF_R ]

View File

@ -73,9 +73,8 @@ Sections:
Members: Members:
- SectionOrType: GRP_COMDAT - SectionOrType: GRP_COMDAT
- SectionOrType: .foo - SectionOrType: .foo
Symbols: Symbols:
Local: - Name: bar
- Name: bar Section: .group
Section: .group - Name: zed
- Name: zed Section: .group1
Section: .group1

View File

@ -210,13 +210,14 @@ Sections:
Link: .symtab Link: .symtab
Content: "0102" Content: "0102"
Symbols: Symbols:
Global: - Name: _Z3fooc
- Name: _Z3fooc Type: STT_FUNC
Type: STT_FUNC Section: .text.foo
Section: .text.foo Binding: STB_GLOBAL
- Name: _Z4blahf - Name: _Z4blahf
Type: STT_FUNC Type: STT_FUNC
Section: .text.foo Section: .text.foo
Binding: STB_GLOBAL
ProgramHeaders: ProgramHeaders:
- Type: PT_LOAD - Type: PT_LOAD
Flags: [ PF_R, PF_X ] Flags: [ PF_R, PF_X ]

View File

@ -28,6 +28,6 @@ Sections:
- Name: .text - Name: .text
Type: SHT_PROGBITS Type: SHT_PROGBITS
Symbols: Symbols:
Global: - Name: foobar
- Name: foobar Section: .text
Section: .text Binding: STB_GLOBAL

View File

@ -41,9 +41,10 @@ Sections:
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: 41505332088020020108800280010202088180808010818080802002080181808080100802818080802004020C7E048180808010088180808020 Content: 41505332088020020108800280010202088180808010818080802002080181808080100802818080802004020C7E048180808010088180808020
Symbols: Symbols:
Global: - Name: sym1
- Name: sym1 Binding: STB_GLOBAL
- Name: sym2 - Name: sym2
Binding: STB_GLOBAL
... ...
# RUN: yaml2obj -docnum 2 %s | llvm-readobj -elf-output-style=LLVM -relocations - | FileCheck --check-prefix=LLVM2 %s # RUN: yaml2obj -docnum 2 %s | llvm-readobj -elf-output-style=LLVM -relocations - | FileCheck --check-prefix=LLVM2 %s
@ -90,9 +91,10 @@ Sections:
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: 415053320A80200202088102830408037C08 Content: 415053320A80200202088102830408037C08
Symbols: Symbols:
Global: - Name: sym1
- Name: sym1 Binding: STB_GLOBAL
- Name: sym2 - Name: sym2
Binding: STB_GLOBAL
... ...
# RUN: yaml2obj -docnum 3 %s | llvm-readobj -elf-output-style=LLVM -relocations - | FileCheck --check-prefix=LLVM3 %s # RUN: yaml2obj -docnum 3 %s | llvm-readobj -elf-output-style=LLVM -relocations - | FileCheck --check-prefix=LLVM3 %s
@ -132,7 +134,8 @@ Sections:
AddressAlign: 0x0000000000000001 AddressAlign: 0x0000000000000001
Content: 415053320680200208800208008001080802008001818080801008818080802002080881808080100008818080802008 Content: 415053320680200208800208008001080802008001818080801008818080802002080881808080100008818080802008
Symbols: Symbols:
Global: - Name: sym1
- Name: sym1 Binding: STB_GLOBAL
- Name: sym2 - Name: sym2
Binding: STB_GLOBAL
... ...

View File

@ -60,8 +60,8 @@ Sections:
Type: R_X86_64_NONE Type: R_X86_64_NONE
Addend: -1 Addend: -1
DynamicSymbols: DynamicSymbols:
Global: - Name: force_dynsym
- Name: force_dynsym Binding: STB_GLOBAL
ProgramHeaders: ProgramHeaders:
- Type: PT_LOAD - Type: PT_LOAD
VAddr: 0x1000 VAddr: 0x1000

View File

@ -84,17 +84,25 @@ Sections:
Symbol: f3 Symbol: f3
Type: R_X86_64_JUMP_SLOT Type: R_X86_64_JUMP_SLOT
Symbols: Symbols:
Global: - Name: f1
- Name: f1 Binding: STB_GLOBAL
- Name: f2 - Name: f2
- Name: g1 Binding: STB_GLOBAL
- Name: _Z2f1v - Name: g1
- Name: f3 Binding: STB_GLOBAL
- Name: _Z2f1v
Binding: STB_GLOBAL
- Name: f3
Binding: STB_GLOBAL
DynamicSymbols: DynamicSymbols:
Global: - Name: f1
- Name: f1 Binding: STB_GLOBAL
- Name: f2 - Name: f2
- Name: g1 Binding: STB_GLOBAL
- Name: _Z2f1v - Name: g1
- Name: f3 Binding: STB_GLOBAL
- Name: _Z2f1v
Binding: STB_GLOBAL
- Name: f3
Binding: STB_GLOBAL
... ...

View File

@ -74,15 +74,15 @@ Sections:
Addend: 1 Addend: 1
Symbol: sym Symbol: sym
Symbols: Symbols:
Global: - Name: sym
- Name: sym Value: 0
Value: 0 Section: .text
Section: .text Binding: STB_GLOBAL
DynamicSymbols: DynamicSymbols:
Global: - Name: sym
- Name: sym Value: 0
Value: 0 Section: .text
Section: .text Binding: STB_GLOBAL
ProgramHeaders: ProgramHeaders:
- Type: PT_LOAD - Type: PT_LOAD
VAddr: 0x1000 VAddr: 0x1000

View File

@ -218,5 +218,5 @@ Sections:
- Name: hiuser - Name: hiuser
Type: 0xffffffff Type: 0xffffffff
Symbols: Symbols:
Global: - Name: foo
- Name: foo Binding: STB_GLOBAL

View File

@ -18,7 +18,6 @@ FileHeader:
Type: ET_REL Type: ET_REL
Machine: EM_X86_64 Machine: EM_X86_64
Symbols: Symbols:
Local: - Name: a_sym
- Name: a_sym Value: 0xfedcba9876543210
Value: 0xfedcba9876543210 Size: 0x0123456789abcdef
Size: 0x0123456789abcdef

View File

@ -52,9 +52,8 @@ Sections:
# Symbol with st_name = 19, binding = 0xf # Symbol with st_name = 19, binding = 0xf
Content: "0000000000000000000000000000000001000000000000000000000030000000090000000000000000000000a0000000100000000000000000000000b0000000130000000000000000000000f0000000" Content: "0000000000000000000000000000000001000000000000000000000030000000090000000000000000000000a0000000100000000000000000000000b0000000130000000000000000000000f0000000"
Symbols: Symbols:
Local: - Name: local
- Name: local - Name: global
Global: Binding: STB_GLOBAL
- Name: global - Name: weak
Weak: Binding: STB_WEAK
- Name: weak

View File

@ -75,20 +75,26 @@ Sections:
EntSize: 4 EntSize: 4
Content: "0000000001000000" Content: "0000000001000000"
Symbols: Symbols:
Global: - Name: undef
- Name: undef Binding: STB_GLOBAL
- Name: normal - Name: normal
Section: .text Section: .text
- Name: common Binding: STB_GLOBAL
Index: SHN_COMMON - Name: common
- Name: absolute Index: SHN_COMMON
Index: SHN_ABS Binding: STB_GLOBAL
- Name: proc - Name: absolute
Index: 0xff01 Index: SHN_ABS
- Name: os Binding: STB_GLOBAL
Index: 0xff21 - Name: proc
- Name: reserved Index: 0xff01
Index: 0xfffe Binding: STB_GLOBAL
- Name: os
Index: 0xff21
Binding: STB_GLOBAL
- Name: reserved
Index: 0xfffe
Binding: STB_GLOBAL
--- !ELF --- !ELF
FileHeader: FileHeader:
@ -97,6 +103,6 @@ FileHeader:
Type: ET_REL Type: ET_REL
Machine: EM_386 Machine: EM_386
Symbols: Symbols:
Global: - Name: bad
- Name: bad Index: 0x42
Index: 0x42 Binding: STB_GLOBAL

View File

@ -51,27 +51,37 @@ Sections:
- Name: .text - Name: .text
Type: SHT_PROGBITS Type: SHT_PROGBITS
Symbols: Symbols:
Global: - Name: notype
- Name: notype Type: STT_NOTYPE
Type: STT_NOTYPE Binding: STB_GLOBAL
- Name: object - Name: object
Type: STT_OBJECT Type: STT_OBJECT
- Name: func Binding: STB_GLOBAL
Type: STT_FUNC - Name: func
- Name: .text Type: STT_FUNC
Type: STT_SECTION Binding: STB_GLOBAL
Section: .text - Name: .text
- Name: file Type: STT_SECTION
Type: STT_FILE Section: .text
- Name: common Binding: STB_GLOBAL
Type: STT_COMMON - Name: file
- Name: tls Type: STT_FILE
Type: STT_TLS Binding: STB_GLOBAL
- Name: gnu_ifunc - Name: common
Type: STT_GNU_IFUNC Type: STT_COMMON
- Name: os_specific Binding: STB_GLOBAL
Type: 11 - Name: tls
- Name: proc_specific Type: STT_TLS
Type: 13 Binding: STB_GLOBAL
- Name: unknown - Name: gnu_ifunc
Type: 7 Type: STT_GNU_IFUNC
Binding: STB_GLOBAL
- Name: os_specific
Type: 11
Binding: STB_GLOBAL
- Name: proc_specific
Type: 13
Binding: STB_GLOBAL
- Name: unknown
Type: 7
Binding: STB_GLOBAL

View File

@ -52,12 +52,15 @@ Sections:
# Symbol with st_name = 1, st_other = 0x4 # Symbol with st_name = 1, st_other = 0x4
Content: "0000000000000000000000000000000001000000000000000000000000040000" Content: "0000000000000000000000000000000001000000000000000000000000040000"
Symbols: Symbols:
Global: - Name: default
- Name: default Visibility: STV_DEFAULT
Visibility: STV_DEFAULT Binding: STB_GLOBAL
- Name: internal - Name: internal
Visibility: STV_INTERNAL Visibility: STV_INTERNAL
- Name: hidden Binding: STB_GLOBAL
Visibility: STV_HIDDEN - Name: hidden
- Name: protected Visibility: STV_HIDDEN
Visibility: STV_PROTECTED Binding: STB_GLOBAL
- Name: protected
Visibility: STV_PROTECTED
Binding: STB_GLOBAL

View File

@ -101,20 +101,22 @@ Sections:
AddressAlign: 0x0000000000000004 AddressAlign: 0x0000000000000004
Content: 040000000900000004000000474E5500676F6C6420312E3131000000 Content: 040000000900000004000000474E5500676F6C6420312E3131000000
Symbols: Symbols:
Local: - Name: reduced.c
- Name: reduced.c Type: STT_FILE
Type: STT_FILE - Type: STT_FILE
- Type: STT_FILE - Name: main
Global: Type: STT_FUNC
- Name: main Section: .text
Type: STT_FUNC Value: 0x0000000000400140
Section: .text Size: 0x0000000000000003
Value: 0x0000000000400140 Binding: STB_GLOBAL
Size: 0x0000000000000003 - Name: _edata
- Name: _edata Value: 0x0000000000401000
Value: 0x0000000000401000 Binding: STB_GLOBAL
- Name: __bss_start - Name: __bss_start
Value: 0x0000000000401000 Value: 0x0000000000401000
- Name: _end Binding: STB_GLOBAL
Value: 0x0000000000401000 - Name: _end
Value: 0x0000000000401000
Binding: STB_GLOBAL
... ...

View File

@ -11,10 +11,9 @@
# CHECK-NEXT: Type: ET_REL # CHECK-NEXT: Type: ET_REL
# CHECK-NEXT: Machine: EM_X86_64 # CHECK-NEXT: Machine: EM_X86_64
# CHECK-NEXT: Symbols: # CHECK-NEXT: Symbols:
# CHECK-NEXT: GNUUnique: # CHECK-NEXT: - Name: foo
# CHECK-NEXT: - Name: foo # CHECK-NEXT: Type: STT_OBJECT
# CHECK-NEXT: Type: STT_OBJECT # CHECK-NEXT: Binding: STB_GNU_UNIQUE
# CHECK-NEXT: DynamicSymbols: {}
# CHECK-NEXT: ... # CHECK-NEXT: ...
--- !ELF --- !ELF
@ -25,6 +24,6 @@ FileHeader:
Type: ET_REL Type: ET_REL
Machine: EM_X86_64 Machine: EM_X86_64
Symbols: Symbols:
GNUUnique: - Name: foo
- Name: foo Type: STT_OBJECT
Type: STT_OBJECT Binding: STB_GNU_UNIQUE

View File

@ -2,4 +2,4 @@
# test that we don't crash when passed object files without a symbol table # test that we don't crash when passed object files without a symbol table
# CHECK-LABEL: FileHeader: # CHECK-LABEL: FileHeader:
# CHECK-LABEL: Sections: # CHECK-LABEL: Sections:
# CHECK-LABEL: Symbols: # CHECK-NOT: Symbols:

View File

@ -4,18 +4,22 @@
## Test checks that we are able to handle symbols with special/reserved indices. ## Test checks that we are able to handle symbols with special/reserved indices.
# CHECK: Symbols: # CHECK: Symbols:
# CHECK-NEXT: Global: # CHECK-NEXT: - Name: absolute
# CHECK-NEXT: - Name: absolute # CHECK-NEXT: Index: SHN_ABS
# CHECK-NEXT: Index: SHN_ABS # CHECK-NEXT: Binding: STB_GLOBAL
# CHECK-NEXT: Value: 0x0000000000001234 # CHECK-NEXT: Value: 0x0000000000001234
# CHECK-NEXT: - Name: common # CHECK-NEXT: - Name: common
# CHECK-NEXT: Index: SHN_COMMON # CHECK-NEXT: Index: SHN_COMMON
# CHECK-NEXT: - Name: valid_index # CHECK-NEXT: Binding: STB_GLOBAL
# CHECK-NEXT: Section: .text # CHECK-NEXT: - Name: valid_index
# CHECK-NEXT: - Name: processor_specific_index # CHECK-NEXT: Section: .text
# CHECK-NEXT: Index: SHN_HEXAGON_SCOMMON_1 # CHECK-NEXT: Binding: STB_GLOBAL
# CHECK-NEXT: - Name: unknown_index # CHECK-NEXT: - Name: processor_specific_index
# CHECK-NEXT: Index: 0x0000FFFE # CHECK-NEXT: Index: SHN_HEXAGON_SCOMMON_1
# CHECK-NEXT: Binding: STB_GLOBAL
# CHECK-NEXT: - Name: unknown_index
# CHECK-NEXT: Index: 0x0000FFFE
# CHECK-NEXT: Binding: STB_GLOBAL
!ELF !ELF
FileHeader: FileHeader:
@ -27,18 +31,22 @@ Sections:
- Name: .text - Name: .text
Type: SHT_PROGBITS Type: SHT_PROGBITS
Symbols: Symbols:
Global: - Name: absolute
- Name: absolute Index: SHN_ABS
Index: SHN_ABS Value: 0x1234
Value: 0x1234 Binding: STB_GLOBAL
- Name: common - Name: common
Index: SHN_COMMON Index: SHN_COMMON
- Name: valid_index Binding: STB_GLOBAL
Index: 0x1 - Name: valid_index
- Name: processor_specific_index Index: 0x1
Index: SHN_HEXAGON_SCOMMON_1 Binding: STB_GLOBAL
- Name: unknown_index - Name: processor_specific_index
Index: 0xfffe Index: SHN_HEXAGON_SCOMMON_1
Binding: STB_GLOBAL
- Name: unknown_index
Index: 0xfffe
Binding: STB_GLOBAL
## shn_xindex.o contains a symbol with st_shndx == SHN_XINDEX. ## shn_xindex.o contains a symbol with st_shndx == SHN_XINDEX.
## We do not support it at this moment. ## We do not support it at this moment.

View File

@ -2,11 +2,12 @@
# RUN: obj2yaml %t | FileCheck %s # RUN: obj2yaml %t | FileCheck %s
# CHECK: Symbols: # CHECK: Symbols:
# CHECK-NEXT: Global: # CHECK-NEXT: - Name: a_known_type
# CHECK-NEXT: - Name: a_known_type # CHECK-NEXT: Type: STT_OBJECT
# CHECK-NEXT: Type: STT_OBJECT # CHECK-NEXT: Binding: STB_GLOBAL
# CHECK-NEXT: - Name: an_unknown_type # CHECK-NEXT: - Name: an_unknown_type
# CHECK-NEXT: Type: 0x07 # CHECK-NEXT: Type: 0x07
# CHECK-NEXT: Binding: STB_GLOBAL
!ELF !ELF
FileHeader: FileHeader:
@ -15,8 +16,9 @@ FileHeader:
Type: ET_REL Type: ET_REL
Machine: EM_X86_64 Machine: EM_X86_64
Symbols: Symbols:
Global: - Name: a_known_type
- Name: a_known_type Type: STT_OBJECT
Type: STT_OBJECT Binding: STB_GLOBAL
- Name: an_unknown_type - Name: an_unknown_type
Type: 0x7 Type: 0x7
Binding: STB_GLOBAL

Some files were not shown because too many files have changed in this diff Show More