HomeFreeBSD

loader: fix endianness conversion

Description

loader: fix endianness conversion

r328536 broke symbol loading on amd64 at least (and probably other
arches). r328826 contained the problem to ppc only by adding
pre-processors guards.

Fix this properly by moving the endianness conversion to separate
helper functions, and make the conversion more robust by using sizeof
instead of having to manually code the size of each field.

Finally list the fields in each structure in a macro in order to avoid
code repetition.

Sponsored by: Citrix Systems R&D
Reviewed by: kib emaste wma
Differential revision: https://reviews.freebsd.org/D14267

Details

Provenance
roygerAuthored on
Reviewer
kib
Differential Revision
D14267: loader: fix endianness conversion
Parents
rS329059: MFC r306325, r306329-r306330, r306333, r306620-r306622, r307544, r307550…
Branches
Unknown
Tags
Unknown