This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Produce DT_RISCV_VARIANT_CC
ClosedPublic

Authored by MaskRay on Aug 12 2021, 1:01 AM.

Details

Summary

https://github.com/riscv/riscv-elf-psabi-doc/pull/190 introduced STO_RISCV_VARIANT_CC.
The linker should do:

  • Copy the STO_RISCV_VARIANT_CC bit to .symtab/.dynsym: already fulfilled after 82ed93ea0552c8f82df05859ee93e70b71c4e65d
  • Produce DT_RISCV_VARIANT_CC if at least one R_RISCV_JUMP_SLOT relocation references a symbol with the STO_RISCV_VARIANT_CC bit. Done by this patch.

Diff Detail

Event Timeline

MaskRay created this revision.Aug 12 2021, 1:01 AM
MaskRay requested review of this revision.Aug 12 2021, 1:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2021, 1:01 AM
MaskRay updated this revision to Diff 479937.Dec 4 2022, 11:40 AM
MaskRay retitled this revision from [ELF] Handle STO_RISCV_VARIANT_PCS to [ELF] Handle STO_RISCV_VARIANT_CC.
MaskRay edited the summary of this revision. (Show Details)

rebase

MaskRay updated this revision to Diff 479938.Dec 4 2022, 11:56 AM

simplify test

kito-cheng accepted this revision.Dec 4 2022, 6:45 PM

LGTM, thanks for complete the lld part of STO_RISCV_VARIANT_CC !

lld/ELF/SyntheticSections.cpp
1426–1429

nit: Maybe llvm::any_of? although use llvm::_find_if can archive same purpose, but any_of might improve readable here?

This revision is now accepted and ready to land.Dec 4 2022, 6:45 PM
MaskRay updated this revision to Diff 479972.Dec 4 2022, 9:00 PM
MaskRay marked an inline comment as done.

use any_of

MaskRay edited the summary of this revision. (Show Details)Dec 4 2022, 9:01 PM
MaskRay updated this revision to Diff 479974.Dec 4 2022, 9:05 PM
MaskRay retitled this revision from [ELF] Handle STO_RISCV_VARIANT_CC to [ELF] Produce DT_RISCV_VARIANT_CC.
MaskRay edited the summary of this revision. (Show Details)

add release note

MaskRay updated this revision to Diff 479975.Dec 4 2022, 9:07 PM

fix release note

This revision was landed with ongoing or failed builds.Dec 4 2022, 9:08 PM
This revision was automatically updated to reflect the committed changes.
MaskRay added inline comments.Dec 4 2022, 9:57 PM
lld/ELF/SyntheticSections.cpp
1426–1429

Thanks for the suggestion!