llvm-6502/lib/Object
Simon Atanasyan 19ab8f850f [yaml2obj][ELF] Add an optional Size field to the YAML section declaration.
Now the only method to configure ELF section's content and size is to assign
a hexadecimal string to the `Content` field. Unfortunately this way is
completely useless when you need to declare a really large section.

To solve this problem this patch adds one more optional field `Size`
to the `RawContentSection` structure. When yaml2obj generates an ELF file
it uses the following algorithm:
1. If both `Content` and `Size` fields are missed create an empty section.
2. If only `Content` field is missed take section length from the `Size`
   field and fill the section by zero.
3. If only `Size` field is missed create a section using data from
   the `Content` field.
4. If both `Content` and `Size` fields are provided validate that the `Size`
   value is not less than size of `Content` data. Than take section length
   from the `Size`, fill beginning of the section by `Content` and the rest
   by zero.

Examples
--------
* Create a section 0x10000 bytes long filled by zero
  Name: .data
  Type: SHT_PROGBITS
  Flags: [ SHF_ALLOC ]
  Size: 0x10000

* Create a section 0x10000 bytes long starting from 'CA' 'FE' 'BA' 'BE'
  Name: .data
  Type: SHT_PROGBITS
  Flags: [ SHF_ALLOC ]
  Content: CAFEBABE
  Size: 0x10000

The patch reviewed by Michael Spencer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208995 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 16:01:00 +00:00
..
Archive.cpp [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-15 06:32:26 +00:00
Binary.cpp Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
CMakeLists.txt ELFObjectWriter: deduplicate suffices in strtab 2014-04-30 16:25:02 +00:00
COFFObjectFile.cpp [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-15 06:32:26 +00:00
COFFYAML.cpp obj2yaml: Don't crash if the characteristics field is zero 2014-04-09 16:38:15 +00:00
ELF.cpp [Sparc] Add support for sparc relocation types in ELF object file. 2014-01-26 03:21:28 +00:00
ELFObjectFile.cpp Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
ELFYAML.cpp [yaml2obj][ELF] Add an optional Size field to the YAML section declaration. 2014-05-16 16:01:00 +00:00
Error.cpp Support: Make error_category's constructor public 2014-03-15 04:05:59 +00:00
IRObjectFile.cpp Remove the linker_private and linker_private_weak linkages. 2014-03-13 23:18:37 +00:00
LLVMBuild.txt LLVMBuild.txt: Add missing dependencies. 2014-04-10 11:16:47 +00:00
MachOObjectFile.cpp [RuntimeDyld] Add support for MachO __jump_table and __pointers sections, and 2014-05-12 21:39:59 +00:00
MachOUniversal.cpp Teach llvm-nm to know about fat archives (aka MachOUniversal files 2014-05-14 21:18:50 +00:00
Makefile
Object.cpp Convert getFileOffset to getOffset and move it to its only user. 2014-04-21 13:45:32 +00:00
ObjectFile.cpp Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
StringTableBuilder.cpp ELFObjectWriter: deduplicate suffices in strtab 2014-04-30 16:25:02 +00:00
SymbolicFile.cpp Add a SymbolicFile interface between Binary and ObjectFile. 2014-02-21 20:10:59 +00:00
YAML.cpp Object: Don't double-escape empty hexdata 2014-03-20 06:28:52 +00:00