[all-commits] [llvm/llvm-project] 428cf7: Reland "[WebAssembly][Object]Use file offset as fu...

Derek Schuff via All-commits all-commits at lists.llvm.org
Wed Jan 3 15:41:08 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 428cf71ffa01c579e0ebf66b7d74eb9cb8d8f3f8
      https://github.com/llvm/llvm-project/commit/428cf71ffa01c579e0ebf66b7d74eb9cb8d8f3f8
  Author: Derek Schuff <dschuff at chromium.org>
  Date:   2024-01-03 (Wed, 03 Jan 2024)

  Changed paths:
    M llvm/lib/Object/WasmObjectFile.cpp
    A llvm/test/tools/llvm-nm/wasm/linked.yaml
    A llvm/test/tools/llvm-objdump/wasm/linked-symbol-table.yaml

  Log Message:
  -----------
  Reland "[WebAssembly][Object]Use file offset as function symbol address for linked files (#76198)"

WebAssembly doesn't have a single virtual memory space the way other object
formats or architectures do, so "addresses" mean different things depending
on the context.
Function symbol addresses in object files are offsets from the start of the code
section. This is good for linking and relocation. However when dealing with
linked binaries, offsets from the start of the file/module are more often
used (e.g. for stack traces in browsers), and are more useful for use
cases like binary size attribution. This PR changes Object to use
the file offset instead of the section offset for function symbols, but
only for linked (non-DSO) files.

This is a reland of fc5f51cf with a fix for the MSan failure (it was not caused
by this change, but it was revealed by the new tests).




More information about the All-commits mailing list