Page MenuHomeFreeBSD

EFI: use common reloc.c for all architectures
ClosedPublic

Authored by emaste on Apr 6 2015, 4:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 20, 4:28 PM
Unknown Object (File)
Feb 15 2024, 4:17 PM
Unknown Object (File)
Jan 26 2024, 11:59 PM
Unknown Object (File)
Dec 28 2023, 5:20 PM
Unknown Object (File)
Dec 20 2023, 2:28 AM
Unknown Object (File)
Nov 13 2023, 10:15 AM
Unknown Object (File)
Nov 9 2023, 9:05 PM
Unknown Object (File)
Nov 5 2023, 1:23 PM
Subscribers

Details

Summary

Much of this file is identical across the architectures we support, so share a common implementation by adding a little #ifdef-ery.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to EFI: use common reloc.c for all architectures.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: andrew, imp.
emaste added subscribers: kib, rpaulo.
sys/boot/efi/loader/reloc.c
105 ↗(On Diff #4701)

Would it make sense for each architecture to define R_NONE and R_RELATIVE (or similar)?

e.g.

#if defined(__amd64__)
#define R_NONE     R_X86_64_NONE
#define R_RELATIVE R_X86_64_RELATIVE
#elif defined(__arm__)
...

I like this, and also Andy's suggestion.

sys/boot/efi/loader/reloc.c
105 ↗(On Diff #4701)

We could add that at the top, and handle any special cases that come up...

sys/boot/efi/loader/reloc.c
105 ↗(On Diff #4701)

Right, we could easily handle relocation types that don't apply to a given arch as well, a la:

#if defined RELOC_TYPE_RELATIVE
case RELOC_TYPE_RELATIVE:
...
#endif

new version coming up shortly

emaste edited edge metadata.

Incorporate #define change suggested by @andrew and add Makefile .PATH setting to pick up reloc.c

imp edited edge metadata.

Do it!

This revision is now accepted and ready to land.Apr 7 2015, 9:29 PM
emaste updated this revision to Diff 4729.

Closed by commit rS281237 (authored by @emaste).