[all-commits] [llvm/llvm-project] fc5f51: [WebAssembly][Object]Use file offset as function s...
Derek Schuff via All-commits
all-commits at lists.llvm.org
Tue Jan 2 14:55:07 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: fc5f51cf5af4364b38bf22e491d46e1e892ade0c
https://github.com/llvm/llvm-project/commit/fc5f51cf5af4364b38bf22e491d46e1e892ade0c
Author: Derek Schuff <dschuff at chromium.org>
Date: 2024-01-02 (Tue, 02 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:
-----------
[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 implements item number 4 from #76107
More information about the All-commits
mailing list