There is a bug in the current implementation of `--icf=safe_thunks` where a STABS entry is emitted for generated thunks. This is problematic as we end up generating invalid DWARF as dsymutil will think the entire function body is at the thunk location, when in actuality there will only be a single branch present. This will end up causing overlapping DWARF entries. To fix this we never generate STABS entries for such thunks. The existing `--icf=safe_thunks` test is updated to also generate debug info and we add a check that no corrupt DWARF is generated. As a future TODO we need to make `--keep-icf-stabs` compatible with `--icf=safe_thunks`.
92 KiB
92 KiB