Commit Graph

13 Commits

Author SHA1 Message Date
Rafael Espindola
2236f9348d Teach llvm-readobj to print human friendly description of reserved sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204584 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24 05:00:34 +00:00
Sean Silva
068463b714 [yaml2obj][ELF] Make symbol table top-level key.
Although in reality the symbol table in ELF resides in a section, the
standard requires that there be no more than one SHT_SYMTAB. To enforce
this constraint, it is cleaner to group all the symbols under a
top-level `Symbols` key on the object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184627 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-22 01:38:00 +00:00
Sean Silva
6f0ca0c590 This was a nifty test, but remove it.
It wouldn't really test anything that doesn't already have a more
targeted test:
`yaml2obj-elf-section-basic.yaml`:
  Already tests that section content is correctly passed though.
`yaml2obj-elf-symbol-basic.yaml` (this file):
  Tests that the st_value and st_size attributes of `main` are set
  correctly.
Between those two tests, disassembling the file doesn't really add
anything, so just remove mention of disassembling the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184607 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 23:17:13 +00:00
Sean Silva
8fa38898ff Revert "Put r184469 disassembler test back on X86"
This reverts commit r184602. In an upcoming commit, I will just remove
the disassembler part of the test; it was mostly just a "nifty" thing
marking a milestone but it doesn't test anything that isn't tested
elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184606 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 23:17:10 +00:00
Renato Golin
b37e50b660 Put r184469 disassembler test back on X86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184602 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 22:42:20 +00:00
Sean Silva
a622a3f450 [yaml2obj][ELF] Don't do disassembly in this test.
This was causing buildbot failures when build without X86 support.

Is there a way to conditionalize the test on the X86 target being
present?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184597 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 21:51:15 +00:00
Sean Silva
326c193e0a [yaml2obj][ELF] Allow expressing undefined symbols.
Previously we unconditionally enforced that section references in
symbols in the YAML had a name that was a section name present in the
object, and linked the references to that section. Now, permit empty
section names (already the default, if the `Section` key is not
provided) to indicate SHN_UNDEF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184513 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 01:11:48 +00:00
Sean Silva
4235ba32f2 [yaml2obj][ELF] Don't explicitly set Binding with STB_*
Instead, just have 3 sub-lists, one for each of
{STB_LOCAL,STB_GLOBAL,STB_WEAK}.

This allows us to be a lot more explicit w.r.t. the symbol ordering in
the object file, because if we allowed explicitly setting the STB_*
`Binding` key for the symbol, then we might have ended up having to
shuffle STB_LOCAL symbols to the front of the list, which is likely to
cause confusion and potential for error.

Also, this new approach is simpler ;)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184506 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 00:27:50 +00:00
Sean Silva
e38f640b22 [yaml2obj][ELF] Add support for st_value and st_size.
After this patch, the ELF file produced by
`yaml2obj-elf-symbol-basic.yaml`, when linked and executed on x86_64
(under SysV ABI, obviously; I tested on Linux), produces a working
executable that goes into an infinite loop!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184469 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-20 20:59:47 +00:00
Sean Silva
6525e92b32 [yaml2obj][ELF] Allow symbols to reference sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184468 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-20 20:59:41 +00:00
Sean Silva
5ba1225fb0 [yaml2obj][ELF] Support st_info through Binding and Type YAML keys.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184263 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-19 00:11:59 +00:00
Sean Silva
ca0170ffa1 [yaml2obj][ELF] Ensure STN_UNDEF entry is present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184258 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 23:19:17 +00:00
Sean Silva
afcf60fe15 [yaml2obj][ELF] Rudimentary symbol table support.
Currently, we only output the name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184255 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-18 23:14:03 +00:00