1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

10 Commits

Author SHA1 Message Date
Rafael Espindola
0d29f912e2 Add dynamic_table iterators back to ELF.h.
In tree they are only used by llvm-readobj, but it is also used by
https://github.com/mono/CppSharp.

While at it, add some missing error checking.

llvm-svn: 244320
2015-08-07 15:25:20 +00:00
Rafael Espindola
833df2a833 Move to llvm-readobj code that is only used there.
lld might end up using a small part of this, but it will be in a much
refactored form. For now this unblocks avoiding the full section scan in the
ELFFile constructor.

This also has a (very small) error handling improvement.

llvm-svn: 244282
2015-08-06 21:54:37 +00:00
Rafael Espindola
8dc741d1bf Simplify iterating over the dynamic section and report broken ones.
llvm-svn: 242712
2015-07-20 21:23:29 +00:00
Rafael Espindola
1c58b24a44 Remove Elf_Rela_Iter and Elf_Rel_Iter.
Use just the pointers and check for invalid relocation sections.

llvm-svn: 242700
2015-07-20 20:07:50 +00:00
Rafael Espindola
3323a6b994 Report errors an invalid virtual addresses.
llvm-svn: 242676
2015-07-20 14:45:03 +00:00
Rafael Espindola
0fb99d1c9a Simplify iterating over program headers and detect corrupt ones.
We now use a simple pointer and have range loops.

llvm-svn: 242669
2015-07-20 13:35:33 +00:00
Rafael Espindola
04bc262b8d llvm-readobj: Handle invalid references to the string table.
llvm-svn: 242658
2015-07-20 03:38:17 +00:00
Rafael Espindola
d3ff9d7446 Move CHECKs closer to the RUN line.
llvm-svn: 242657
2015-07-20 03:31:25 +00:00
Rafael Espindola
7c36fd7751 llvm-readobj: call exit(1) on error.
llvm-readobj exists for testing llvm. We can safely stop the program
the first time we know the input in corrupted.

This is in preparation for making it handle a few more broken files.

llvm-svn: 242656
2015-07-20 03:23:55 +00:00
Michael J. Spencer
8cdf1cca41 [Object] Split the ELF interface into 3 parts.
* ELFTypes.h contains template magic for defining types based on endianess, size, and alignment.
* ELFFile.h defines the ELFFile class which provides low level ELF specific access.
* ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface.

llvm-svn: 188022
2013-08-08 22:27:13 +00:00