diff options
author | jkoshy <jkoshy@FreeBSD.org> | 2006-12-18 05:40:01 +0000 |
---|---|---|
committer | jkoshy <jkoshy@FreeBSD.org> | 2006-12-18 05:40:01 +0000 |
commit | 25bc13b7367e813ef4d53432a4e4383099e93ba0 (patch) | |
tree | 5ded8ca022a55b5ca759f3341c1e05289fb61a08 /lib/libelf/libelf_msize.m4 | |
parent | fdbeae7cd48d220f22f51d00a1b3c7c6525973ee (diff) | |
download | FreeBSD-src-25bc13b7367e813ef4d53432a4e4383099e93ba0.zip FreeBSD-src-25bc13b7367e813ef4d53432a4e4383099e93ba0.tar.gz |
Use <osreldate.h> rather than the OS version reported by the kernel
to determine which Elf Types are to be handled. Change the M4
templates to wrap an `#if __FreeBSD_version >= NNN'/`#endif' pair
around the generated code for each ELF data type, where `NNN' is
the OS version where the ELF type was added to the source tree.
This change allows cross-builds of old sources on newer FreeBSD
systems to work correctly.
Problem reported by: ru
Diffstat (limited to 'lib/libelf/libelf_msize.m4')
-rw-r--r-- | lib/libelf/libelf_msize.m4 | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/libelf/libelf_msize.m4 b/lib/libelf/libelf_msize.m4 index cb0e2bb..3e73591 100644 --- a/lib/libelf/libelf_msize.m4 +++ b/lib/libelf/libelf_msize.m4 @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include <assert.h> #include <libelf.h> +#include <osreldate.h> #include <string.h> #include "_libelf.h" @@ -57,14 +58,6 @@ define(MOVEP_SIZE, 0) define(SXWORD_SIZE32, 0) define(XWORD_SIZE32, 0) -ifelse(eval(OSRELDATE < 700009),1, - `define(`CAP_SIZE', 0) - define(`LWORD_SIZE', 0) - define(`MOVE_SIZE', 0) - define(`SYMINFO_SIZE', 0) - define(`VDEF_SIZE', 0) - define(`VNEED_SIZE', 0)',`') - define(`DEFINE_ELF_MSIZE', `ifdef($1`_SIZE', `define($1_SIZE32,$1_SIZE) @@ -81,7 +74,9 @@ define(`DEFINE_ELF_MSIZES', DEFINE_ELF_MSIZES(ELF_TYPE_LIST) define(`MSIZE', - `[ELF_T_$1] = { .msz32 = $1_SIZE32, .msz64 = $1_SIZE64 },') + `#if __FreeBSD_version >= $3 + [ELF_T_$1] = { .msz32 = $1_SIZE32, .msz64 = $1_SIZE64 }, +#endif') define(`MSIZES', `ifelse($#,1,`', `MSIZE($1) |