Skip to content

Conversation

@Jvlegod
Copy link
Contributor

@Jvlegod Jvlegod commented Dec 19, 2025

References:

  1. https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc
  2. https://riscv-non-isa.github.io/riscv-elf-psabi-doc/

RISC-V ELF psABI version 1.1 (November 26, 2025).

Given the current psABI specification, the #PR165 is no longer applicable.

Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are breaking changes, and I need to understand why several constants were deleted

Comment on lines 876 to 878
pub const R_RISCV_GNU_VTINHERIT: u32 = 41;
/// GNU C++ vtable member usage
pub const R_RISCV_GNU_VTENTRY: u32 = 42;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why were these deleted and also constant changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#relocations

The documentation shows that this conforms to the latest RISC-V ELF psABI specification.

for now:

  1. Change number 41 from GNU_VTINHERIT to GOT32_PCREL

  2. Change number 42 to reserved

image

discuss: riscv-non-isa/riscv-elf-psabi-doc#323

image

This has been discussed in the community.

They appeared to be copied from other ports while there is no assembly syntax
for them. Just remove them like we remove R_RISCV_GPREL_[IS].

Removing R_RISCV_RVC_LUI looks good, like we removed R_RISCV_GNU_VTINHERIT, R_RISCV_GNU_VTENTRY, R_RISCV_GPREL_I, R_RISCV_GPREL_S that were not produced by assemblers.

It seems that since numbers 41-42 were never used before and were initially set as reserved, and now that number 41 has a new number, I think it's necessary to modify them.

Comment on lines 885 to 894
/// Absolute address (CI-Type)
pub const R_RISCV_RVC_LUI: u32 = 46;
/// GP-relative reference (I-Type)
pub const R_RISCV_GPREL_I: u32 = 47;
/// GP-relative reference (S-Type)
pub const R_RISCV_GPREL_S: u32 = 48;
/// TP-relative TLS LE load (I-Type)
pub const R_RISCV_TPREL_I: u32 = 49;
/// TP-relative TLS LE store (S-Type)
pub const R_RISCV_TPREL_S: u32 = 50;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete why were these all deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are the same as above. 46-50 should be reserved here.

image

same here:

  1. R_RISCV_RVC_LUI: Remove R_RISCV_RVC_LUI riscv-non-isa/riscv-elf-psabi-doc#400
  2. R_RISCV_GPREL_{I/S}: Revert "Add GP-relative relocations" riscv-non-isa/riscv-elf-psabi-doc#427
  3. R_RISCV_TPREL_{I/S}:
    • https://patchwork.ozlabs.org/project/glibc/patch/mvmzfrrrj83.fsf@suse.de/
    • Update the list of RISC-V relocations from the ELF psABI as of June 2024.
      It removes binutils-internal only relocations that were never part of
      actual object files. The GNU_VTINHERIT and GNU_VTENTRY relocations were
      never used because the corresponding GCC option -fvtable-gc was never
      supported on RISC-V.

@Jvlegod
Copy link
Contributor Author

Jvlegod commented Jan 4, 2026

If you think this is reasonable, I'd like to amend the PR again, because I'm reviewing the code again and found that some annotations seem to need to be changed as well.

@m4b
Copy link
Owner

m4b commented Jan 4, 2026

Of course feel free to push or force push as much as you as want, it’s your PR :)

so just fyi removing the pub constants is technically a breaking change and it would be pushed back a bit as I like to roll up breaking changes. Alternatively can leave them in and it won’t be and will be in a minor release

@Jvlegod
Copy link
Contributor Author

Jvlegod commented Jan 4, 2026

so just fyi removing the pub constants is technically a breaking change and it would be pushed back a bit as I like to roll up breaking changes. Alternatively can leave them in and it won’t be and will be in a minor release

Here's a suggestion: I'll dedicate a separate PR to the destructive changes and address it when you feel the time is right. In this PR, I'll be making changes to the non-destructive parts.

What do you think?😎

@m4b
Copy link
Owner

m4b commented Jan 4, 2026

Sounds great !

@Jvlegod
Copy link
Contributor Author

Jvlegod commented Jan 5, 2026

I have removed the parts that caused the breaking changes.

you can see #510.

Jvlegod added a commit to Jvlegod/goblin that referenced this pull request Jan 5, 2026
This PR is a breaking change to m4b#507.

Signed-off-by: Jvle <keke.oerv@isrc.iscas.ac.cn>
Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome thank you!

@m4b m4b merged commit c029a2c into m4b:master Jan 5, 2026
5 checks passed
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.

2 participants