]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ldconfig: support hints files of either byte-order
authorStefan Eßer <se@FreeBSD.org>
Wed, 28 Feb 2024 17:49:29 +0000 (18:49 +0100)
committerStefan Eßer <se@FreeBSD.org>
Wed, 28 Feb 2024 17:49:29 +0000 (18:49 +0100)
commite0dfecadf5946b6a8ad423be4eb1c14017b3a8a7
tree8f4ab6b3e71c18dc53ea0f8d751627a8d8a58545
parentcf4d9bf8b38819da12c6d686d5cf6dbd6353cd61
ldconfig: support hints files of either byte-order

Make the ldconfig program accept hints files in little-endian and
big-endian format on all architectures.

The default format is the native byte-order of the respective host.
This is expected to change when a version of the pkg command is
available that implements support for either byte-order in its
internal ldconfig function. (Already committed in the development
tree of the pkg utility, a release is expected at the end of Q1/2024).

This update adds the -B option to the ldconfig program. It enforces
the creation of a big-endian hints file on a little-endian host.
The main purpose to is support of tests with non-native byte-order
files on little-endian hosts. It will be removed when all supported
FreeBSD releases use little-endian hints files by default.

When little-endian hints files are generally used, support of
either byte-order in libexec/rtld can also be removed.

When support for big-endian hints files is no longer required,
the COND_SWAP macro in ldconfig and rtld shall be replaced by
le32toh(), which just return their argument on little-endian
architectures.

Approved by: kib
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D44093
sbin/ldconfig/elfhints.c
sbin/ldconfig/ldconfig.8
sbin/ldconfig/ldconfig.c
sbin/ldconfig/ldconfig.h