Page MenuHomePhabricator

[MC][X86] Allow SHT_PROGBITS for .eh_frame on x86-64
ClosedPublic

Authored by MaskRay on Mar 13 2020, 12:56 PM.

Details

Summary

GNU as emits SHT_PROGBITS .eh_frame by default for .cfi_* directives.
We follow x86-64 psABI and use SHT_X86_64_UNWIND for .eh_frame

Don't error for SHT_PROGBITS .eh_frame on x86-64.
This keeps compatibility for .section .eh_frame,"a",@progbits in existing assembly files.

See https://groups.google.com/d/msg/x86-64-abi/7sr4E6THl3g/zUU2UPHOAQAJ
for more discussions.

Diff Detail

Event Timeline

MaskRay created this revision.Mar 13 2020, 12:56 PM
MaskRay edited the summary of this revision. (Show Details)Mar 13 2020, 1:11 PM
MaskRay updated this revision to Diff 250597.Mar 16 2020, 10:36 AM
MaskRay edited the summary of this revision. (Show Details)

Repurpose

joerg added a subscriber: joerg.Mar 16 2020, 1:31 PM

This looks much better than the in-tree state, thanks.

MaskRay updated this revision to Diff 250673.Mar 16 2020, 6:59 PM
MaskRay retitled this revision from [MC] Don't use SHT_X86_64_UNWIND for .eh_frame on non-Solaris OSes to [MC][X86] Allow SHT_PROGBITS for .eh_frame on x86-64.

Fix test. Fix title.

joerg accepted this revision.Mar 28 2020, 3:42 PM

Can you add a variation with .pushsection for @progbits and @nobits? Otherwise LGTM.

This revision is now accepted and ready to land.Mar 28 2020, 3:42 PM

Can you add a variation with .pushsection for @progbits and @nobits? Otherwise LGTM.

I think a .pushsection test will be redundant as it shares code with .section.

I am waiting for the resolution https://groups.google.com/forum/#!topic/x86-64-abi/7sr4E6THl3g , otherwise I cannot say "x86-64 psABI allows SHT_PROGBITS as an alternative section type" :/

joerg added a comment.Mar 28 2020, 5:18 PM

We tend to test push .section and .pushsection in this file, so it would be nice to continue doing that.

grimar added a subscriber: grimar.Mar 30 2020, 4:29 AM
MaskRay updated this revision to Diff 258089.Apr 16 2020, 10:42 AM
MaskRay edited the summary of this revision. (Show Details)

Mention GNU as but drop mention of x86-64 psABI change (which hasn't happened yet and may not happen)

This revision was automatically updated to reflect the committed changes.