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
F104052454: D2241.id4729.diff
Mon, Dec 2, 9:34 PM
Unknown Object (File)
Sat, Nov 30, 12:52 PM
Unknown Object (File)
Mon, Nov 25, 11:56 AM
Unknown Object (File)
Mon, Nov 25, 5:39 AM
Unknown Object (File)
Thu, Nov 21, 12:38 AM
Unknown Object (File)
Mon, Nov 18, 10:22 PM
Unknown Object (File)
Thu, Nov 14, 9:54 PM
Unknown Object (File)
Wed, Nov 6, 12:17 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).