[all-commits] [llvm/llvm-project] 8959ec: [WebAssembly] Add target architecture to object fi...
Sam Clegg via All-commits
all-commits at lists.llvm.org
Mon Sep 28 11:26:17 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8959ec064109a202c05cf0e1751cc953a7634f63
https://github.com/llvm/llvm-project/commit/8959ec064109a202c05cf0e1751cc953a7634f63
Author: Sam Clegg <sbc at chromium.org>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
M lld/test/wasm/check-arch-32-in-64.test
M lld/test/wasm/check-arch-64-in-32.test
M lld/test/wasm/dylink.s
M lld/test/wasm/emit-relocs.s
M lld/test/wasm/locals-duplicate.test
M lld/test/wasm/lto/relocatable-undefined.ll
M lld/test/wasm/pie.s
M lld/test/wasm/relocatable.ll
M lld/test/wasm/rpath.s
M lld/test/wasm/shared-needed.s
M lld/test/wasm/shared-weak-undefined.s
M lld/test/wasm/shared.s
M lld/test/wasm/shared64.s
M lld/test/wasm/signature-mismatch-relocatable.s
M lld/test/wasm/signature-mismatch.s
M lld/test/wasm/stack-pointer.s
M lld/test/wasm/tls-export.s
M lld/test/wasm/weak-alias.s
M lld/wasm/InputFiles.cpp
M lld/wasm/SyntheticSections.cpp
M llvm/include/llvm/BinaryFormat/Wasm.h
M llvm/include/llvm/ObjectYAML/WasmYAML.h
M llvm/lib/MC/WasmObjectWriter.cpp
M llvm/lib/Object/WasmObjectFile.cpp
M llvm/lib/ObjectYAML/WasmEmitter.cpp
M llvm/lib/ObjectYAML/WasmYAML.cpp
M llvm/test/CodeGen/WebAssembly/profile.ll
M llvm/test/MC/WebAssembly/assembler-binary.ll
M llvm/test/MC/WebAssembly/call-indirect-relocs.s
M llvm/test/MC/WebAssembly/comdat.ll
M llvm/test/MC/WebAssembly/common.s
M llvm/test/MC/WebAssembly/custom-sections.ll
M llvm/test/MC/WebAssembly/data-section.s
M llvm/test/MC/WebAssembly/debug-info.ll
M llvm/test/MC/WebAssembly/debug-info64.ll
M llvm/test/MC/WebAssembly/export-name.s
M llvm/test/MC/WebAssembly/function-sections.ll
M llvm/test/MC/WebAssembly/global-ctor-dtor.ll
M llvm/test/MC/WebAssembly/globals.s
M llvm/test/MC/WebAssembly/init-array-label.s
M llvm/test/MC/WebAssembly/init-array.s
M llvm/test/MC/WebAssembly/reloc-pic.s
M llvm/test/MC/WebAssembly/reloc-pic64.s
M llvm/test/MC/WebAssembly/tables.s
M llvm/test/MC/WebAssembly/tag-section.s
M llvm/test/MC/WebAssembly/tls.s
M llvm/test/MC/WebAssembly/tls64.s
M llvm/test/MC/WebAssembly/type-index.s
M llvm/test/MC/WebAssembly/unnamed-data.ll
M llvm/test/MC/WebAssembly/wasm64.s
M llvm/test/MC/WebAssembly/weak-alias.s
M llvm/test/ObjectYAML/wasm/dylink_section.yaml
M llvm/test/ObjectYAML/wasm/linking_section.yaml
M llvm/tools/obj2yaml/wasm2yaml.cpp
Log Message:
-----------
[WebAssembly] Add target architecture to object file format (#225979)
Store the target architecture string (`wasm32` or `wasm64`) in a new
`WASM_TARGET_ARCH` subsection in the `linking` custom section and in a
new `WASM_DYLINK_TARGET_ARCH` subsection in the `dylink.0` custom
section.
Previously, architecture detection for object files and shared libraries
relied on heuristics (such as whether memory64 was imported/defined or
presence of 64-bit relocations). For modules that do not access memory,
this resulted in wasm64 objects/shared libraries being incorrectly
detected as wasm32.
With this change:
- `WasmObjectWriter` emits the `WASM_TARGET_ARCH` subsection in
`linking`.
- `wasm-ld` emits `WASM_DYLINK_TARGET_ARCH` when generating shared
libraries and `WASM_TARGET_ARCH` when generating relocatable output
(`-r`).
- `WasmObjectFile::getArch()` checks these subsections first before
falling back to the `HasMemory64` heuristic.
- `SharedFile` in `lld` now checks the object architecture via
`checkArch()`.
- Added support to `obj2yaml` and `yaml2obj`.
Fixes: #98778
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list