[llvm] r183954 - [yaml2obj] Add sh_addr via `Address` key.
Sean Silva
silvas at purdue.edu
Thu Jun 13 15:19:54 PDT 2013
Author: silvas
Date: Thu Jun 13 17:19:54 2013
New Revision: 183954
URL: http://llvm.org/viewvc/llvm-project?rev=183954&view=rev
Log:
[yaml2obj] Add sh_addr via `Address` key.
Modified:
llvm/trunk/include/llvm/Object/ELFYAML.h
llvm/trunk/lib/Object/ELFYAML.cpp
llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml
llvm/trunk/tools/yaml2obj/yaml2elf.cpp
Modified: llvm/trunk/include/llvm/Object/ELFYAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFYAML.h?rev=183954&r1=183953&r2=183954&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFYAML.h (original)
+++ llvm/trunk/include/llvm/Object/ELFYAML.h Thu Jun 13 17:19:54 2013
@@ -53,6 +53,7 @@ struct Section {
StringRef Name;
ELF_SHT Type;
ELF_SHF Flags;
+ llvm::yaml::Hex64 Address;
};
struct Object {
FileHeader Header;
Modified: llvm/trunk/lib/Object/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFYAML.cpp?rev=183954&r1=183953&r2=183954&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELFYAML.cpp (original)
+++ llvm/trunk/lib/Object/ELFYAML.cpp Thu Jun 13 17:19:54 2013
@@ -265,6 +265,7 @@ void MappingTraits<ELFYAML::Section>::ma
IO.mapOptional("Name", Section.Name, StringRef());
IO.mapRequired("Type", Section.Type);
IO.mapOptional("Flags", Section.Flags, ELFYAML::ELF_SHF(0));
+ IO.mapOptional("Address", Section.Address, Hex64(0));
}
void MappingTraits<ELFYAML::Object>::mapping(IO &IO, ELFYAML::Object &Object) {
Modified: llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml?rev=183954&r1=183953&r2=183954&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-section-basic.yaml Thu Jun 13 17:19:54 2013
@@ -9,6 +9,7 @@ Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0xDEADBEEF
# CHECK: Section {
# CHECK: Index: 0
@@ -21,3 +22,4 @@ Sections:
# CHECK-NEXT: SHF_ALLOC (0x2)
# CHECK-NEXT: SHF_EXECINSTR (0x4)
# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0xDEADBEEF
Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=183954&r1=183953&r2=183954&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Thu Jun 13 17:19:54 2013
@@ -132,7 +132,7 @@ static void writeELF(raw_ostream &OS, co
SHeader.sh_name = StrTab.addString(Sec.Name);
SHeader.sh_type = Sec.Type;
SHeader.sh_flags = Sec.Flags;
- SHeader.sh_addr = 0;
+ SHeader.sh_addr = Sec.Address;
SHeader.sh_offset = 0;
SHeader.sh_size = 0;
SHeader.sh_link = 0;
More information about the llvm-commits
mailing list