This is an archive of the discontinued LLVM Phabricator instance.

[hwasan] Add .Linterceptor_sigsetjmp
ClosedPublic

Authored by hjl.tools on Jan 31 2023, 10:20 AM.

Details

Summary

Older GNU assemblers generate R_X86_64_PC32 relocation against
defined non-weak global branch targets with default visibility. A
linker may issue an error when building a shared library. Add a local
alias, .Linterceptor_sigsetjmp, to interceptor_sigsetjmp to avoid
R_X86_64_PC32 relocation for "jmp
interceptor_sigsetjmp" with older
GNU assemblers.

Fixes: https://github.com/llvm/llvm-project/issues/60426

Diff Detail

Event Timeline

hjl.tools created this revision.Jan 31 2023, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2023, 10:20 AM
Herald added subscribers: Enna1, pengfei. · View Herald Transcript
hjl.tools requested review of this revision.Jan 31 2023, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2023, 10:20 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
MaskRay added a comment.EditedJan 31 2023, 10:58 AM

Looks good. Shall we use a .L label so that the relocation references a STT_SECTION symbol instead of a new STB_LOCAL symbol?
Avoiding multiple STB_LOCAL symbols at the same location is usually a good idea.

hjl.tools updated this revision to Diff 493716.Jan 31 2023, 1:14 PM
hjl.tools retitled this revision from [hwasan] Add __interceptor_sigsetjmp_internal to [hwasan] Add .Linterceptor_sigsetjmp.
hjl.tools edited the summary of this revision. (Show Details)
MaskRay accepted this revision.Jan 31 2023, 1:58 PM
This revision is now accepted and ready to land.Jan 31 2023, 1:58 PM
vitalybuka accepted this revision.Jan 31 2023, 2:17 PM
This revision was automatically updated to reflect the committed changes.