llvm.org GIT mirror llvm / 45b812d
[yaml2obj] Add sh_addr via `Address` key. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183954 91177308-0d34-0410-b5e6-96231b3b80d8 Sean Silva 7 years ago
4 changed file(s) with 5 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5252 StringRef Name;
5353 ELF_SHT Type;
5454 ELF_SHF Flags;
55 llvm::yaml::Hex64 Address;
5556 };
5657 struct Object {
5758 FileHeader Header;
264264 IO.mapOptional("Name", Section.Name, StringRef());
265265 IO.mapRequired("Type", Section.Type);
266266 IO.mapOptional("Flags", Section.Flags, ELFYAML::ELF_SHF(0));
267 IO.mapOptional("Address", Section.Address, Hex64(0));
267268 }
268269
269270 void MappingTraits::mapping(IO &IO, ELFYAML::Object &Object) {
88 - Name: .text
99 Type: SHT_PROGBITS
1010 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
11 Address: 0xDEADBEEF
1112
1213 # CHECK: Section {
1314 # CHECK: Index: 0
2021 # CHECK-NEXT: SHF_ALLOC (0x2)
2122 # CHECK-NEXT: SHF_EXECINSTR (0x4)
2223 # CHECK-NEXT: ]
24 # CHECK-NEXT: Address: 0xDEADBEEF
131131 SHeader.sh_name = StrTab.addString(Sec.Name);
132132 SHeader.sh_type = Sec.Type;
133133 SHeader.sh_flags = Sec.Flags;
134 SHeader.sh_addr = 0;
134 SHeader.sh_addr = Sec.Address;
135135 SHeader.sh_offset = 0;
136136 SHeader.sh_size = 0;
137137 SHeader.sh_link = 0;