233 Commits

Author SHA1 Message Date
Sam Clegg
45c215a28e [WebAssembly] Add support for dylink section in object format
See https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md.

Differential Revision: https://reviews.llvm.org/D54490

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346880 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 18:36:24 +00:00
Heejin Ahn
8bcdd04bce [WebAssembly] Add support for the event section
Summary:
This adds support for the 'event section' specified in the exception
handling proposal. (This was named 'exception section' first, but later
renamed to 'event section' to take possibilities of other kinds of
events into consideration. But currently we only store exception info in
this section.)

The event section is added between the global section and the export
section. This is for ease of validation per request of the V8 team.

This patch:
- Creates the event symbol type, which is a weak symbol
- Makes 'throw' instruction take the event symbol '__cpp_exception'
- Adds relocation support for events
- Adds WasmObjectWriter / WasmObjectFile (Reader) support
- Adds obj2yaml / yaml2obj support
- Adds '.eventtype' printing support

Reviewers: dschuff, sbc100, aardappel

Subscribers: jgravelle-google, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D54096

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346825 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 02:46:21 +00:00
Fangrui Song
3b35e17b21 llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)
Summary: The convenience wrapper in STLExtras is available since rL342102.

Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb

Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits

Differential Revision: https://reviews.llvm.org/D52573

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27 02:13:45 +00:00
Heejin Ahn
581d231e61 [WebAssembly] clang-format (NFC)
Summary: This patch runs clang-format on all wasm-only files.

Reviewers: aardappel, dschuff, sunfish, tlively

Subscribers: MatzeB, sbc100, jgravelle-google, llvm-commits

Differential Revision: https://reviews.llvm.org/D51447

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341439 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-05 01:27:38 +00:00
George Rimar
f23f849bd1 [yaml2obj] - Allow to use numeric sh_link (Link) value for sections.
That change allows using numeric values for Link field.
It is consistent with the code for another fields in this method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339873 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 12:44:17 +00:00
George Rimar
d9d671112d [yaml2elf] - Simplify code, add a test. NFC.
This simplifies the code allowing to set the sh_info
for relocations sections. And adds a missing test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339870 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 12:23:22 +00:00
George Rimar
312924a2b1 [yaml2obj] - Teach yaml2obj to produce SHT_GROUP section with a custom Info field.
This allows to set custom Info field value for SHT_GROUP sections.

It is useful to allow this because we would be able to replace at least one binary
object committed in LLD and replace it with the yaml2obj based test.

Differential revision: https://reviews.llvm.org/D50776

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339772 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 13:55:22 +00:00
George Rimar
3ea0447ec7 [yaml2obj] - Teach tool to produce SHT_GROUP section with a custom type.
Currently, it is possible to use yaml2obj for producing SHT_GROUP sections
of type GRP_COMDAT. For LLD test case I need to produce an object with
a broken (different from GRP_COMDAT) type.

The patch teaches tool to do such things.

Differential revision: https://reviews.llvm.org/D50761

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339764 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 11:43:00 +00:00
George Rimar
b40956fe64 [yaml2obj] - Add a support for changing EntSize.
I was trying to add a test case for LLD and found that it
is impossible to set sh_entsize via yaml.
The patch implements the missing part.

Differential revision: https://reviews.llvm.org/D50235

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339113 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-07 08:11:38 +00:00
Paul Semel
f3f578d286 [yaml2obj] Add default sh_entsize for dynamic sections
Dynamic section holds a table, so the sh_entsize might be set. As the
dynamic section entry size never changes, we can default it to the size
of a dynamic entry.

Differential Revision: https://reviews.llvm.org/D49619

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337725 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 18:49:04 +00:00
Jake Ehrlich
eefdbb43aa [llvm-readobj] Add experimental support for SHT_RELR sections
This change adds experimental support for SHT_RELR sections, proposed
here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

Definitions for the new ELF section type and dynamic array tags, as well
as the encoding used in the new section are all under discussion and are
subject to change. Use with caution!

Author: rahulchaudhry

Differential Revision: https://reviews.llvm.org/D47919

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335922 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28 21:07:34 +00:00
Adrian Prantl
26b584c691 Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

  for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done

Differential Revision: https://reviews.llvm.org/D46290

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331272 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 15:54:18 +00:00
Sam Clegg
db15975983 [WebAssembly] Write DWARF data into wasm object file
- Writes ".debug_XXX" into corresponding custom sections.
- Writes relocation records into "reloc.debug_XXX" sections.

Patch by Yury Delendik!

Differential Revision: https://reviews.llvm.org/D44184

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330982 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26 19:27:28 +00:00
Sam Clegg
14598cb5be [WebAssembly] Add version to object file metadata
Summary: See https://github.com/WebAssembly/tool-conventions/issues/54

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D46069

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330969 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26 18:15:32 +00:00
Sam Clegg
194a4e0c23 [WebAssembly] Use section index in relocation section header
Rather than referring to sections my their code, use the
absolute index of the target section within the module.

See https://github.com/WebAssembly/tool-conventions/issues/52

Differential Revision: https://reviews.llvm.org/D45980

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330749 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-24 18:11:36 +00:00
Jonas Devlieghere
ae6875ea1d [tools] Use WithColor for printing errors.
Use convenience helpers in WithColor to print errors, warnings and notes
in a few more tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330524 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-21 21:11:59 +00:00
Rui Ueyama
0b9d56a30e Define InitLLVM to do common initialization all at once.
We have a few functions that virtually all command wants to run on
process startup/shutdown. This patch adds InitLLVM class to do that
all at once, so that we don't need to copy-n-paste boilerplate code
to each llvm command's main() function.

Differential Revision: https://reviews.llvm.org/D45602

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330046 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 18:26:06 +00:00
Sam Clegg
b068ce98cd [WebAssembly] libObject: Don't include the name the size of custom sections
Differential Revision: https://reviews.llvm.org/D45579

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329947 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 20:31:12 +00:00
Alexandre Ganea
2031cf6be1 [Debuginfo][COFF] Minimal serialization support for precompiled types records
This change adds support for the LF_PRECOMP and LF_ENDPRECOMP records required
to read/write Microsoft precompiled types .objs.
See https://en.wikipedia.org/wiki/Precompiled_header#Microsoft_Visual_C_and_C++

This also adds handling for the .debug$P section, which is actually a .debug$T
section in disguise, found only in precompiled .objs.

Differential Revision: https://reviews.llvm.org/D45283

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329613 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 20:17:56 +00:00
Mandeep Singh Grang
4ead3eb171 [tools] Change std::sort to llvm::sort in response to r327219
Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.

Reviewers: JDevlieghere, zturner, echristo, dberris, friss

Reviewed By: echristo

Subscribers: gbedwell, llvm-commits

Differential Revision: https://reviews.llvm.org/D45141

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328943 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-01 21:24:53 +00:00
Sam Clegg
9f474dee9e [WebAssembly] Use uint8_t for single byte values to match the spec
The original BinaryEncoding.md document used to specify that
these values were `varint7`, but the official spec lists them
explicitly as single byte values and not LEB.

A similar change for wabt is in flight:
 https://github.com/WebAssembly/wabt/pull/782

Differential Revision: https://reviews.llvm.org/D43921

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326454 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-01 18:06:21 +00:00
Sam Clegg
e14b24839c [WebAssembly] Remove DataSize from linking metadata section
Neither the linker nor the runtime need this information
anymore.  We were originally using this to model BSS size
but the plan is now to use the segment metadata to allow
for BSS segments.

Differential Revision: https://reviews.llvm.org/D41366

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326267 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27 23:57:37 +00:00
Benjamin Kramer
f998d9c065 [WebAssembly] NDEBUG is spelled without a leading underscore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325893 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-23 12:20:18 +00:00
Sam Clegg
d5784797c6 [WebAssembly] Add first claass symbol table to wasm objects
This is combination of two patches by Nicholas Wilson:
  1. https://reviews.llvm.org/D41954
  2. https://reviews.llvm.org/D42495

Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
  to avoid the extra byte used when writing data symbols.  Although this
  bit is redundant for other symbols types (i.e. undefined can be
  implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.

Differential Revision: https://reviews.llvm.org/D43147

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325860 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-23 05:08:34 +00:00
Rui Ueyama
5a286a0041 Instead of ELFFile<ELFT>::Type, use ELFT::Type. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322346 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-12 02:28:31 +00:00
Rui Ueyama
0a75940cb9 Use ELF{32,64}{LE,BE} instead of ELFType<{little,big}, {true,false}>. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322342 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-12 01:40:32 +00:00
Sam Clegg
e92250ac8f [WebAssembly] Add COMDAT support
This adds COMDAT support to the Wasm object-file format.
Spec: https://github.com/WebAssembly/tool-conventions/pull/31

Corresponding LLD change:
https://bugs.llvm.org/show_bug.cgi?id=35533, and D40845

Patch by Nicholas Wilson

Differential Revision: https://reviews.llvm.org/D40844

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322135 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 23:43:14 +00:00
Sam Clegg
6b54fc31e5 [WebAssembly] Explicitly specify function/global index space in YAML
These indexes are useful because they are not always zero based and
functions and globals are referenced elsewhere by their index.

This matches what we already do for the type index space.

Differential Revision: https://reviews.llvm.org/D41877

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322121 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 21:38:53 +00:00
Benjamin Kramer
ca5092a11a Avoid int to string conversion in Twine or raw_ostream contexts.
Some output changes from uppercase hex to lowercase hex, no other functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28 16:58:54 +00:00
Sam Clegg
e1acb56f11 [WebAssembly] Add support for init functions linking metadata
Summary:
This change lays the groundwork lowering of @llvm.global_ctors
and @llvm.global_dtors for the wasm object format.  Some parts
of this patch are subset of: https://reviews.llvm.org/D40759

See https://github.com/WebAssembly/tool-conventions/issues/25

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish

Differential Revision: https://reviews.llvm.org/D41208

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320742 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 21:10:03 +00:00
Sam Clegg
2b46be6545 [WebAssembly] Add linking metatdata test coverage for wasm2yaml
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish

Differential Revision: https://reviews.llvm.org/D41196

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 21:53:40 +00:00
Michael Zolotukhin
d770752b5c Remove redundant includes from tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 21:31:10 +00:00
Zachary Turner
8b348680b2 Update obj2yaml and yaml2obj for .debug$H section.
Differential Revision: https://reviews.llvm.org/D40842

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:58:48 +00:00
Dave Lee
9c5b799781 Add ELF dynamic symbol support to yaml2obj/obj2yaml
Summary:
This change introduces a `DynamicSymbols` field to the ELF specific YAML
supported by `yaml2obj` and `obj2yaml`. This grouping of symbols provides a way
to represent ELF dynamic symbols. The `DynamicSymbols` structure is identical to
the existing `Symbols`.

Reviewers: compnerd, jakehehrlich, silvas

Reviewed By: silvas

Subscribers: silvas, jakehehrlich, llvm-commits

Differential Revision: https://reviews.llvm.org/D39582

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 18:10:15 +00:00
Dave Lee
9a5be1f566 Reapply: Allow yaml2obj to order implicit sections for ELF
Summary:
This change allows yaml input to control the order of implicitly added sections
(`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a
placeholder section of the given name to the Sections field.

This change is to support changes in D39582, where it is desirable to control
the location of the `.dynsym` section.

This reapplied version fixes:
  1. use of a function call within an assert
  2. failing lld test which has an unnamed section
  3. incorrect section count when given an unnamed section

Additionally, one more test to cover the unnamed section failure.

Reviewers: compnerd, jakehehrlich

Reviewed By: jakehehrlich

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D39749

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09 14:53:43 +00:00
Dave Lee
aeaece745d Revert "Reapply: Allow yaml2obj to order implicit sections for ELF"
This reverts commit r317646.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317654 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 01:31:20 +00:00
Dave Lee
9fd7184f64 Reapply: Allow yaml2obj to order implicit sections for ELF
Summary:
This change allows yaml input to control the order of implicitly added sections
(`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a
placeholder section of the given name to the Sections field.

This change is to support changes in D39582, where it is desirable to control
the location of the `.dynsym` section.

This reapplied version fixes:
  1. use of a function call within an assert
  2. failing lld test which has an unnamed section

Additionally, one more test to cover the unnamed section failure.

Reviewers: compnerd, jakehehrlich

Reviewed By: jakehehrlich

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D39749

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 00:58:50 +00:00
Dave Lee
7c6de050f8 Revert "Allow yaml2obj to order implicit sections for ELF"
Also, revert "Fix build bots after r317622"

This reverts commit r317622, r317626.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 22:51:27 +00:00
Dave Lee
1d494b9e82 Fix build bots after r317622
Example build failure: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/14660

TIL that the warning flags for local builds are loose compared to what build
servers use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317626 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 22:33:07 +00:00
Dave Lee
595a4486c1 Allow yaml2obj to order implicit sections for ELF
Summary:
This change allows yaml input to control the order of implicitly added sections
(`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a
placeholder section of the given name to the Sections field.

This change is to support changes in D39582, where it is desirable to control
the location of the `.dynsym` section.

Reviewers: compnerd, jakehehrlich

Reviewed By: jakehehrlich

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D39749

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317622 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 22:05:24 +00:00
Jake Ehrlich
9ae2da659f [yaml2obj][ELF] Add support for setting alignment in program headers
Sometimes program headers have larger alignments than any of the
sections they contain. Currently yaml2obj can't produce such files. A
bug recently appeared in llvm-objcopy that failed in such a case. I'd
like to be able to add tests to llvm-objcopy for such cases.

This change adds an optional alignment parameter to program headers that
will be used instead of calculating the alignment.

Differential Revision: https://reviews.llvm.org/D39130

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-01 23:14:48 +00:00
Sam Clegg
e2864173a3 [WebAssembly] Allow each data segment to specify its own alignment
Also, add a flags field as we will almost certainly
be needing that soon too.

Differential Revision: https://reviews.llvm.org/D38296

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29 16:50:08 +00:00
Reid Kleckner
97ca964f3d [Support] Rename tool_output_file to ToolOutputFile, NFC
This class isn't similar to anything from the STL, so it shouldn't use
the STL naming conventions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314050 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-23 01:03:17 +00:00
Sam Clegg
81e3824428 Reland "[WebAssembly] Add support for naming wasm data segments"
Add adds support for naming data segments.  This is useful
useful linkers so that they can merge similar sections.

Differential Revision: https://reviews.llvm.org/D37886

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 19:03:35 +00:00
Mike Edwards
097fb8c422 Reverting due to Green Dragon bot failure.
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42594/


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 01:21:02 +00:00
Sam Clegg
e5c43345fb [WebAssembly] Add support for naming wasm data segments
Add adds support for naming data segments.  This is useful
useful linkers so that they can merge similar sections.

Differential Revision: https://reviews.llvm.org/D37886

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 23:00:57 +00:00
Petr Hosek
746c778562 [yaml2obj][ELF] Add support for symbol indexes greater than SHN_LORESERVE
Right now Symbols must be either undefined or defined in a specific
section. Some symbols have section indexes like SHN_ABS however. This
change adds support for outputting symbols that have such section
indexes.

Patch by Jake Ehrlich

Differential Revision: https://reviews.llvm.org/D37391

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 20:44:16 +00:00
Sam Clegg
8b020d7228 [WebAssembly] Update relocation names to match spec
Summary: See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md

Differential Revision: https://reviews.llvm.org/D37385

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01 17:32:01 +00:00
Petr Hosek
8231133535 [yaml2obj][ELF] Make symbols optional for relocations
Some kinds of relocations do not have symbols, like R_X86_64_RELATIVE
for instance. I would like to test this case in D36554 but currently
can't because symbols are required by yaml2obj. The other option is
using the empty symbol but that doesn't seem quite right to me.

This change makes the Symbol field of Relocation optional and in the
case where the user does not specify a symbol name the Symbol index is 0.

Patch by Jake Ehrlich

Differential Revision: https://reviews.llvm.org/D37276

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312192 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30 23:13:31 +00:00
Petr Hosek
e7726ca81f [yaml2obj][ELF] Add support for program headers
This change adds basic support for program headers.

I need to do some testing which requires generating program headers but
I can't use ld.lld or clang to produce programs that have headers. I'd
also like to test some strange things that those programs may never
produce.

Patch by Jake Ehrlich

Differential Revision: https://reviews.llvm.org/D35276

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308520 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19 20:38:46 +00:00