Page MenuHomeFreeBSD

powerpc: add R_PPC_ADDR32 handler for kldxref
ClosedPublic

Authored by alfredo on Jan 4 2022, 8:42 PM.
Referenced Files
F103068055: D33745.diff
Wed, Nov 20, 12:31 PM
Unknown Object (File)
Wed, Oct 30, 11:22 AM
Unknown Object (File)
Tue, Oct 29, 6:09 AM
Unknown Object (File)
Oct 19 2024, 6:58 PM
Unknown Object (File)
Oct 19 2024, 3:09 PM
Unknown Object (File)
Oct 5 2024, 8:30 PM
Unknown Object (File)
Oct 5 2024, 12:40 AM
Unknown Object (File)
Oct 4 2024, 7:19 AM
Subscribers

Details

Summary

Implements R_PPC_ADDR32 handler for kldxref, addressing "kldxref: unhandled relocation type 1" when running "kldxref /boot/kernel" on powerpc 32 bits.
Apparently this relocation appeared after in-tree LLVM compiler upgrade between versions LLVM11 and 13.

In this change added a "where32" variable with type Elf32_Addr when destination is word32 on both 32 or 64 bits and guarded PPC64-only relocation with an ifdef. Comments are welcome.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43706
Build 40594: arc lint + arc unit

Event Timeline

Looks good.

usr.sbin/kldxref/ef_powerpc.c
67

No change is really needed here, but maybe just cast 'where' to (Elf32_Addr *)?

This revision is now accepted and ready to land.Jan 6 2022, 6:53 PM
alfredo added inline comments.
usr.sbin/kldxref/ef_powerpc.c
67

yes but the cast need to be later since at this point we don't know what data size is going to be used.
Then I preferred to create a new variable here and use it where appropriate, following the pattern used on other architectures.

This revision was automatically updated to reflect the committed changes.