[all-commits] [llvm/llvm-project] aa0c57: [WebAssembly] Add new relocation for location rela...

Yuta Saito via All-commits all-commits at lists.llvm.org
Mon Mar 8 11:34:55 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aa0c571a5fa9130ccd932f9b6970440a1bae177f
      https://github.com/llvm/llvm-project/commit/aa0c571a5fa9130ccd932f9b6970440a1bae177f
  Author: Yuta Saito <kateinoigakukun at gmail.com>
  Date:   2021-03-08 (Mon, 08 Mar 2021)

  Changed paths:
    A lld/test/wasm/reloc-relative.s
    M lld/wasm/InputChunks.cpp
    M lld/wasm/InputFiles.cpp
    M lld/wasm/InputFiles.h
    M llvm/include/llvm/BinaryFormat/WasmRelocs.def
    M llvm/include/llvm/MC/MCWasmObjectWriter.h
    M llvm/lib/BinaryFormat/Wasm.cpp
    M llvm/lib/MC/WasmObjectWriter.cpp
    M llvm/lib/Object/RelocationResolver.cpp
    M llvm/lib/Object/WasmObjectFile.cpp
    M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp
    M llvm/test/MC/WebAssembly/bad-fixup-expr.s
    A llvm/test/MC/WebAssembly/reloc-relative.ll

  Log Message:
  -----------
  [WebAssembly] Add new relocation for location relative data

This `R_WASM_MEMORY_ADDR_SELFREL_I32` relocation represents an offset
between its relocating address and the symbol address. It's very similar
to `R_X86_64_PC32` but restricted to be used for only data segments.

```
S + A - P
```

A: Represents the addend used to compute the value of the relocatable
field.
P: Represents the place of the storage unit being relocated.
S: Represents the value of the symbol whose index resides in the
relocation entry.

Proposal: https://github.com/WebAssembly/tool-conventions/issues/162

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




More information about the All-commits mailing list