History log of /llvm-project/llvm/lib/MC/WasmObjectWriter.cpp (Results 1 – 25 of 262)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 73beb153 21-Jan-2025 Kazu Hirata <kazu@google.com>

[MC] Avoid repeated hash lookups (NFC) (#123698)


# 9fdc38c8 18-Jan-2025 Derek Schuff <dschuff@chromium.org>

[WebAssembly][Object] Support more elem segment flags (#123427)

Some tools (e.g. Rust tooling) produce element segment descriptors with
neither
elemkind or element type descriptors, but with init

[WebAssembly][Object] Support more elem segment flags (#123427)

Some tools (e.g. Rust tooling) produce element segment descriptors with
neither
elemkind or element type descriptors, but with init exprs instead of
func indices
(this is with the flags value of 4 in

https://webassembly.github.io/spec/core/binary/modules.html#element-section).
LLVM doesn't fully model reference types or the various ways to
initialize element
segments, but we do want to correctly parse and skip over all type
sections, so
this change updates the object parser to handle that case, and refactors
for more
clarity.

The test file is updated to include one additional elem segment with a
flags value
of 4, an initializer value of (32.const 0) and an empty vector.

Also support parsing files that export imported (undefined) functions.

show more ...


Revision tags: llvmorg-19.1.7
# 2cf3d059 22-Dec-2024 Fangrui Song <i@maskray.me>

[MC] Simplify WasmObjectWriter

and make it fit well with the future when MCFragment content is
out-of-line.


Revision tags: llvmorg-19.1.6
# ed91843d 10-Dec-2024 George Stagg <george.stagg@posit.co>

[WebAssembly] Handle symbols in `.init_array` sections (#119127)

Follow on from #111008.


# ac5dd455 04-Dec-2024 George Stagg <georgestagg@gmail.com>

[WebAssembly] Support multiple `.init_array` fragments when writing Wasm objects (#111008)


Revision tags: llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# b76100e2 02-Jul-2024 Fangrui Song <i@maskray.me>

WasmObjectWriter: replace the MCAsmLayout parameter with MCAssembler


# 78804f89 01-Jul-2024 Fangrui Song <i@maskray.me>

[MC] Remove the evaluateAsAbsolute overload that takes a MCAsmLayout parameter

Continue the MCAsmLayout removal work started by 67957a45ee1ec42ae1671cdbfa0d73127346cc95.


# dbf12b2f 01-Jul-2024 Fangrui Song <i@maskray.me>

[MC] Remove MCAsmLayout::{getSymbolOffset,getBaseSymbol}

The MCAsmLayout::* forwarders added by
67957a45ee1ec42ae1671cdbfa0d73127346cc95 have all been removed.


# a40ca78b 01-Jul-2024 Fangrui Song <i@maskray.me>

[MC] Remove MCAsmLayout::{getSectionFileSize,getSectionAddressSize}


# 6b707a8c 01-Jul-2024 Fangrui Song <i@maskray.me>

[MC] Remove the MCAsmLayout parameter from MCObjectWriter::executePostLayoutBinding


# 23e62243 01-Jul-2024 Fangrui Song <i@maskray.me>

[MC] Remove the MCAsmLayout parameter from MCObjectWriter::{writeObject,writeSectionData}


# 4289c422 01-Jul-2024 Fangrui Song <i@maskray.me>

[MC] Remove the MCAsmLayout parameter from MCObjectWriter::recordRelocation


# 46beeaa3 20-Jun-2024 aengelke <engelke@in.tum.de>

[MC] Remove SectionKind from MCSection (#96067)

There are only three actual uses of the section kind in MCSection:
isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and
store othe

[MC] Remove SectionKind from MCSection (#96067)

There are only three actual uses of the section kind in MCSection:
isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and
store other info in the actual section variants where required.

ELF and COFF flags also encode all relevant information, so for these
two section variants, remove the SectionKind parameter entirely.

This allows to remove the string switch (which is unnecessary and
inaccurate) from createELFSectionImpl. This was introduced in
[D133456](https://reviews.llvm.org/D133456), but apparently, it was
never hit for non-writable sections anyway and the resulting kind was
never used.

show more ...


Revision tags: llvmorg-18.1.8
# de19f7b6 11-Jun-2024 Fangrui Song <i@maskray.me>

[MC] Replace fragment ilist with singly-linked lists

Fragments are allocated with `operator new` and stored in an ilist with
Prev/Next/Parent pointers. A more efficient representation would be an
ar

[MC] Replace fragment ilist with singly-linked lists

Fragments are allocated with `operator new` and stored in an ilist with
Prev/Next/Parent pointers. A more efficient representation would be an
array of fragments without the overhead of Prev/Next pointers.

As the first step, replace ilist with singly-linked lists.

* `getPrevNode` uses have been eliminated by previous changes.
* The last use of the `Prev` pointer remains: for each subsection, there is an insertion point and
the current insertion point is stored at `CurInsertionPoint`.
* `HexagonAsmBackend::finishLayout` needs a backward iterator. Save all
fragments within `Frags`. Hexagon programs are usually small, and the
performance does not matter that much.

To eliminate `Prev`, change the subsection representation to
singly-linked lists for subsections and a pointer to the active
singly-linked list. The fragments from all subsections will be chained
together at layout time.

Since fragment lists are disconnected before layout time, we can remove
`MCFragment::SubsectionNumber` (https://reviews.llvm.org/D69411). The
current implementation of `AttemptToFoldSymbolOffsetDifference` requires
future improvement for robustness.

Pull Request: https://github.com/llvm/llvm-project/pull/95077

show more ...


# cb63abca 11-Jun-2024 Fangrui Song <i@maskray.me>

[MC] Remove getFragmentList uses. NFC


# 554a2fa4 06-Jun-2024 Sam Clegg <sbc@chromium.org>

[WebAssembly] Fix element segments in wasm64 object files (#94617)

Followup to #94487


# c2244f82 06-Jun-2024 Sam Clegg <sbc@chromium.org>

[WebAssembly] Set IS_64 flag correctly on __indirect_function_table in object files (#94487)

Follow up to #92042


Revision tags: llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1
# 7f409cd8 25-Jan-2024 Derek Schuff <dschuff@chromium.org>

[Object][Wasm] Allow parsing of GC types in type and table sections (#79235)

This change allows a WasmObjectFile to be created from a wasm file even
if it uses typed funcrefs and GC types. It does

[Object][Wasm] Allow parsing of GC types in type and table sections (#79235)

This change allows a WasmObjectFile to be created from a wasm file even
if it uses typed funcrefs and GC types. It does not significantly change how
lib/Object models its various internal types (e.g. WasmSignature,
WasmElemSegment), so LLVM does not really "support" or understand such
files, but it is sufficient to parse the type, global and element sections, discarding
types that are not understood. This is useful for low-level binary tools such as
nm and objcopy, which use only limited aspects of the binary (such as function
definitions) or deal with sections as opaque blobs.

This is done by allowing `WasmValType` to have a value of `OTHERREF`
(representing any unmodeled reference type), and adding a field to
`WasmSignature` indicating it's a placeholder for an unmodeled reference
type (since there is a 1:1 correspondence between WasmSignature objects
and types in the type section).
Then the object file parsers for the type and element sections are expanded
to parse encoded reference types and discard any unmodeled fields.

show more ...


Revision tags: llvmorg-19-init
# 103fa325 17-Jan-2024 Derek Schuff <dschuff@chromium.org>

[WebAssembly] Use ValType instead of integer types to model wasm tables (#78012)

LLVM models some features found in the binary format with raw integers
and others with nested or enumerated types. T

[WebAssembly] Use ValType instead of integer types to model wasm tables (#78012)

LLVM models some features found in the binary format with raw integers
and others with nested or enumerated types. This PR switches modeling of
tables and segments to use wasm::ValType rather than uint32_t. This NFC
change is in preparation for modeling more reference types, but IMO is
also cleaner and closer to the spec.

show more ...


# f5f2c313 25-Dec-2023 Kazu Hirata <kazu@google.com>

[llvm] Use StringRef::consume_front (NFC)


# 586ecdf2 12-Dec-2023 Kazu Hirata <kazu@google.com>

[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::

[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3
# 4a0ccfa8 13-Oct-2023 Kazu Hirata <kazu@google.com>

Use llvm::endianness::{big,little,native} (NFC)

Note that llvm::support::endianness has been renamed to
llvm::endianness while becoming an enum class as opposed to an
enum. This patch replaces suppo

Use llvm::endianness::{big,little,native} (NFC)

Note that llvm::support::endianness has been renamed to
llvm::endianness while becoming an enum class as opposed to an
enum. This patch replaces support::{big,little,native} with
llvm::endianness::{big,little,native}.

show more ...


Revision tags: llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4
# 111fcb0d 02-Sep-2023 Fangrui Song <i@maskray.me>

[llvm] Fix duplicate word typos. NFC

Those fixes were taken from https://reviews.llvm.org/D137338


Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 220fe00a 11-Jul-2023 Brendan Dahl <brendan.dahl@gmail.com>

[WebAssembly] Support `annotate` clang attributes for marking functions.

Annotation attributes may be attached to a function to mark it with
custom data that will be contained in the final Wasm file

[WebAssembly] Support `annotate` clang attributes for marking functions.

Annotation attributes may be attached to a function to mark it with
custom data that will be contained in the final Wasm file. The
annotation causes a custom section named
"func_attr.annotate.<name>.<arg0>.<arg1>..." to be created that will
contain each function's index value that was marked with the annotation.

A new patchable relocation type for function indexes had to be created so
the custom section could be updated during linking.

Reviewed By: sbc100

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

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2
# 65d4d62a 18-Apr-2023 Akshay Khadse <akshayskhadse@gmail.com>

Fix uninitialized pointer members in MC

Reviewed By: LuoYuanke

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


1234567891011