Skip to content

[DWARFLinker] Constrain a function's high_pc to its own symbol (#215952) - #13867

Open
JDevlieghere wants to merge 1 commit into
swiftlang:stable/23.xfrom
JDevlieghere:cherypick-5e8490a
Open

[DWARFLinker] Constrain a function's high_pc to its own symbol (#215952)#13867
JDevlieghere wants to merge 1 commit into
swiftlang:stable/23.xfrom
JDevlieghere:cherypick-5e8490a

Conversation

@JDevlieghere

Copy link
Copy Markdown

Mach-O objects built with .subsections_via_symbols make every symbol an independently placeable atom, and the linker packs atoms without preserving the spacing they had in the object file.

I have an example where the compiler describes such a subprogram as extending past its own atom. While it's debatable whether that's a good idea, it's not invalid in the object file. However, once linked, it is invalid.

We can make dsymutil resilient against this by looking at the size of the symbol in the debug map and adjusting the end_pc. I'm doing so conservatively so that only a collision is repaired. Already overlapping/invalid ranges remain untouched.

rdar://184768778
(cherry picked from commit 5e8490a)

…215952)

Mach-O objects built with .subsections_via_symbols make every symbol an
independently placeable atom, and the linker packs atoms without
preserving the spacing they had in the object file.

I have an example where the compiler describes such a subprogram as
extending past its own atom. While it's debatable whether that's a good
idea, it's not invalid in the object file. However, once linked, it is
invalid.

We can make dsymutil resilient against this by looking at the size of
the symbol in the debug map and adjusting the end_pc. I'm doing so
conservatively so that only a collision is repaired. Already
overlapping/invalid ranges remain untouched.

rdar://184768778
(cherry picked from commit 5e8490a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant