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

32 Commits

Author SHA1 Message Date
Rui Ueyama
0acac7750e Object/COFF: change data type of SymbolNumber from int16 to uint16.
Microsoft PE/COFF Spec clearly states that the field is of signed interger
type. However, in reality, it's unsigned. If cl.exe needs to create a large
number of sections for COMDAT sections, it will just create more than 32768
sections. Handling large section number as negative number is not correct.
I think this is a spec bug.

Differential Revision: http://llvm-reviews.chandlerc.com/D3088

llvm-svn: 203986
2014-03-15 00:04:08 +00:00
Saleem Abdulrasool
caaf63404a Object: rename ARMV7 to ARMNT
The official specifications state the name to be ARMNT (as per the Microsoft
Portable Executable and Common Object Format Specification v8.3).

llvm-svn: 203530
2014-03-11 03:08:37 +00:00
Alp Toker
e89523ae73 [C++11] Expand and eliminate the LLVM_ENUM_INT_TYPE() macro
llvm-svn: 202607
2014-03-02 03:20:38 +00:00
Rui Ueyama
f81e57de36 Rename IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA.
editbin.exe and link.exe both accepts /highentropyva option to set this bit, so
doing s/VIRTUAL_ADDRESS/VA/ should make sense.

llvm-svn: 200191
2014-01-27 04:22:24 +00:00
Rui Ueyama
3422ecd95a COFF: Add a missing enum value for high entropy ASLR.
That bit is not documented in the PE/COFF spec published by Microsoft, so we
don't know the official name of it. I named this bit
IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VIRTUAL_ADDRESS because the bit is
reported as "high entropy virtual address" by dumpbin.exe,

llvm-svn: 200121
2014-01-26 05:05:23 +00:00
Rui Ueyama
d3ee04d357 Remove unused typedef.
llvm-svn: 200118
2014-01-26 04:50:15 +00:00
Rui Ueyama
4f80cb3b52 Support/COFF: Fix PEHeader struct, and define PE32Header as its alias.
This change does not affect anything because everybody seems to be using
Object/COFF.h instead. But the definition is not for PE32 but for PE32+,
so fix it anyway.

llvm-svn: 200038
2014-01-24 20:54:10 +00:00
Rui Ueyama
d72d820fdd Add constants for optional header magic field.
llvm-svn: 199972
2014-01-24 04:21:00 +00:00
Timur Iskhodzhanov
3d72e1e9e4 Teach the llvm-readobj COFF dumper to dump debug line tables from object files
Reviewed at http://llvm-reviews.chandlerc.com/D2425

llvm-svn: 197674
2013-12-19 11:37:14 +00:00
Reid Kleckner
333fd129ac Explicitly request unsigned enum types when desired
The underlying type of all plain enums in MSVC is 'int', even if the
enumerator contains large 32-bit unsigned values or values greater than
UINT_MAX.  The only way to get a large or unsigned enum type is to
request it explicitly with the C++11 strong enum types feature.

However, since LLVM isn't C++11 yet, I had to add a conditional
LLVM_ENUM_INT_TYPE to Compiler.h to control its usage.

The motivating true positive for this change is compiling PointerIntPair
with MSVC for win64.  The PointerIntMask value is supposed to be pointer
sized value of all ones with some low zeros.  Instead, it's truncated to
32-bits!  We are only saved later because it is sign extended back in
the AND with int64_t, and we happen to want all ones.

This silences lots of -Wmicrosoft warnings during a clang self-host
targeting Windows.

llvm-svn: 191241
2013-09-23 23:26:57 +00:00
Saleem Abdulrasool
8bf43161b3 [Support] fix compile with -Werror
error: commas at the end of enumerator lists are a C++11 extension
[-Werror,-Wc++11-extensions]

llvm-svn: 189183
2013-08-24 20:35:16 +00:00
Saleem Abdulrasool
3a64befc22 [Support] add missing enumeration values
This adds additional missing Windows subsystem identifiers to the
IMAGE_SUBSYSTEM enumeration.

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
llvm-svn: 189180
2013-08-24 20:14:40 +00:00
Rui Ueyama
434e7513be COFF: Add constants for optional data directory.
llvm-svn: 186377
2013-07-16 03:11:55 +00:00
Rui Ueyama
f9939fdb3c [PECOFF] Remove COFF header from PE header for simplicity.
COFF header is always present both in executable and in object file. PE header
is present only in executable. So the natural way to handle PE/COFF file is
treating COFF is mandatory header and PE is optional. Current data structre
does not allow it, because PE header includes COFF header. Removing COFF
header will simplify the code to handle PE/COFF files.

Reviewers: Bigcheese

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D952

llvm-svn: 183788
2013-06-11 21:39:48 +00:00
Eric Christopher
df46cef31b Implements low-level object file format specific output for COFF and
ELF with support for:

- File headers
- Section headers + data
- Relocations
- Symbols
- Unwind data (only COFF/Win64)

The output format follows a few rules:
- Values are almost always output one per line (as elf-dump/coff-dump already do). - Many values are translated to something readable (like enum names), with the raw value in parentheses.
- Hex numbers are output in uppercase, prefixed with "0x".
- Flags are sorted alphabetically.
- Lists and groups are always delimited.

Example output:
---------- snip ----------
Sections [
  Section {
    Index: 1
    Name: .text (5)
    Type: SHT_PROGBITS (0x1)
    Flags [ (0x6)
      SHF_ALLOC (0x2)
      SHF_EXECINSTR (0x4)
    ]
    Address: 0x0
    Offset: 0x40
    Size: 33
    Link: 0
    Info: 0
    AddressAlignment: 16
    EntrySize: 0
    Relocations [
      0x6 R_386_32 .rodata.str1.1 0x0
      0xB R_386_PC32 puts 0x0
      0x12 R_386_32 .rodata.str1.1 0x0
      0x17 R_386_PC32 puts 0x0
    ]
    SectionData (
      0000: 83EC04C7 04240000 0000E8FC FFFFFFC7  |.....$..........|
      0010: 04240600 0000E8FC FFFFFF31 C083C404  |.$.........1....|
      0020: C3                                   |.|
    )
  }
]
---------- snip ----------

Relocations and symbols can be output standalone or together with the section header as displayed in the example.
This feature set supports all tests in test/MC/COFF and test/MC/ELF (and I suspect all additional tests using elf-dump), making elf-dump and coff-dump deprecated.

Patch by Nico Rieck!

llvm-svn: 178679
2013-04-03 18:31:38 +00:00
Jakub Staszak
f1ea1a7f37 Fix include guards so they exactly match file names.
llvm-svn: 172025
2013-01-10 00:45:19 +00:00
Michael J. Spencer
adb12be31a [yaml2obj] Fix incorrect use of signed values.
llvm-svn: 161900
2012-08-14 22:42:31 +00:00
Michael J. Spencer
9f255feb3f Add yaml2obj. A utility to convert YAML to binaries.
yaml2obj takes a textual description of an object file in YAML format
and outputs the binary equivalent. This greatly simplifies writing
tests that take binary object files as input.

llvm-svn: 161205
2012-08-02 19:16:56 +00:00
Michael J. Spencer
5a53bd3002 [Support/COFF] Make the order of members in symbol match the standard.
llvm-svn: 156785
2012-05-14 22:43:21 +00:00
Michael J. Spencer
d410d36be0 Remove extra ,.
llvm-svn: 144759
2011-11-16 01:36:50 +00:00
Michael J. Spencer
796bb719a3 Support/COFF: Add structs and enums from the standard for image files.
llvm-svn: 144756
2011-11-16 01:24:57 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Michael J. Spencer
f9a7c39ecc MC-COFF: Add support for default-null weak externals.
llvm-svn: 116666
2010-10-16 08:25:57 +00:00
Michael J. Spencer
bdf3b8770f MC-COFF: Fix Simple and Complex type. Fixes PR8320.
llvm-svn: 116037
2010-10-08 03:17:11 +00:00
Michael J. Spencer
fc3f9d7c92 Fix Whitespace.
llvm-svn: 116036
2010-10-08 03:16:56 +00:00
Michael J. Spencer
3363f79ebb COFF: Fix incorrect SCT_COMPLEX_TYPE_SHIFT. Add a few constants.
llvm-svn: 112703
2010-09-01 14:09:36 +00:00
Michael J. Spencer
18689045ce MC: Add partial x86-64 support to COFF.
llvm-svn: 111728
2010-08-21 05:58:13 +00:00
Anton Korobeynikov
8c6bfd1c24 Add some win64 coff goodness.
Patch by Cameron Esfahani!

llvm-svn: 111287
2010-08-17 21:05:54 +00:00
Michael J. Spencer
9d96c92bde MC: Add WinCOFFObjectWriter implementation.
Origonal Windows COFF implementation by Nathan Jedffords.

llvm-svn: 109389
2010-07-26 02:17:32 +00:00
Chris Lattner
2793cb1bd6 Merge lib/Target/X86/X86COFF.h into include/llvm/Support/COFF.h,
patch by Michael Spencer!

llvm-svn: 108342
2010-07-14 18:14:33 +00:00
Daniel Dunbar
6202aeaec6 Remove stray comma.
llvm-svn: 107425
2010-07-01 20:20:05 +00:00
Daniel Dunbar
cc754e66c6 MC: Move COFF enumeration constants to llvm/Support/COFF.h, patch by Michael
Spencer!

llvm-svn: 107418
2010-07-01 20:07:24 +00:00