[all-commits] [llvm/llvm-project] 740468: [lld-macho] Fix compatibility between --icf=safe_t...
alx32 via All-commits
all-commits at lists.llvm.org
Wed Nov 20 09:37:14 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 74046855981bad2847c8f03114efd731da4d216c
https://github.com/llvm/llvm-project/commit/74046855981bad2847c8f03114efd731da4d216c
Author: alx32 <103613512+alx32 at users.noreply.github.com>
Date: 2024-11-20 (Wed, 20 Nov 2024)
Changed paths:
M lld/MachO/Arch/ARM64.cpp
M lld/MachO/ICF.cpp
M lld/MachO/ICF.h
M lld/MachO/SyntheticSections.cpp
M lld/MachO/SyntheticSections.h
M lld/MachO/Target.h
M lld/test/MachO/icf-safe-thunks-dwarf.ll
Log Message:
-----------
[lld-macho] Fix compatibility between --icf=safe_thunks and --keep-icf-stabs (#116687)
Currently when `--icf=safe_thunks` is used, `STABS` entries cannot be
generated for ICF'ed functions. This is because if ICF converts a full
function into a thunk and then we generate a `STABS` entry for the
thunk, `dsymutil` will expect to find the entire function body at the
location of the thunk. Because just a thunk will be present at the
location of the `STABS` entry - dsymutil will generate invalid debug
info for such scenarios.
With this change, if `--icf=safe_thunks` is used and `--keep-icf-stabs`
is also specified, STABS entries will be created for all functions, even
merged ones. However, the STABS entries will point at the actual (full)
function body while having the name of the thunk. This way we still get
program correctness as well as correct DWARF data. When doing this, the
debug data will be identical to the scenario where we're using
`--icf=all` and `--keep-icf-stabs`, but the actual program will also
contain thunks, which won't show up in the DWARF data.
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