This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Allow .variant_pcs before the symbol is registered
ClosedPublic

Authored by MaskRay on Mar 25 2022, 2:37 PM.

Details

Summary

glibc sysdeps/aarch64/tst-vpcs-mod.S has something like:

.variant_pcs    vpcs_call
.global vpcs_call

This is supported by GNU as but leads to an error in MC. Use getOrCreateSymbol
to support a not-yet-registered symbol: call registerSymbol to ensure the
symbol exists even if there is no binding directive, to match GNU as.

While here, improve tests to check (1) a local symbol can get
STO_AARCH64_VARIANT_PCS (2) undefined .variant_pcs (3) an alias does not
inherit STO_AARCH64_VARIANT_PCS.

Diff Detail

Event Timeline

MaskRay created this revision.Mar 25 2022, 2:37 PM
MaskRay requested review of this revision.Mar 25 2022, 2:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2022, 2:37 PM
MaskRay updated this revision to Diff 418330.Mar 25 2022, 2:49 PM
MaskRay edited the summary of this revision. (Show Details)

fix another gas incompatible with registerSymbol

MaskRay updated this revision to Diff 418351.Mar 25 2022, 3:50 PM
MaskRay edited the summary of this revision. (Show Details)

add an alias test

Please add a testcase where the symbol is local, for example:

.variant_pcs foo
foo:

(Not sure that's actually useful, but it's well-defined, as far as I can tell.)

MaskRay updated this revision to Diff 418741.Mar 28 2022, 5:21 PM
MaskRay edited the summary of this revision. (Show Details)

Test local symbol

This revision is now accepted and ready to land.Mar 28 2022, 5:32 PM
MaskRay retitled this revision from [AArch64] Allow .variant_pcs before binding directive to [AArch64] Allow .variant_pcs before the symbol is registered.Mar 28 2022, 5:47 PM
MaskRay edited the summary of this revision. (Show Details)
This revision was landed with ongoing or failed builds.Mar 28 2022, 5:52 PM
This revision was automatically updated to reflect the committed changes.