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_convert.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_convert.m4')
-rw-r--r-- | lib/libelf/libelf_convert.m4 | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/libelf/libelf_convert.m4 b/lib/libelf/libelf_convert.m4 index 0eb0b70..5027ef9 100644 --- a/lib/libelf/libelf_convert.m4 +++ b/lib/libelf/libelf_convert.m4 @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include <assert.h> #include <libelf.h> +#include <osreldate.h> #include <string.h> #include "_libelf.h" @@ -234,15 +235,6 @@ define(`IGNORE', IGNORE(MOVEP) IGNORE(NOTE) -ifelse(eval(OSRELDATE < 700009),1, - `IGNORE(CAP) - IGNORE(MOVE) - IGNORE(SYMINFO) - IGNORE(VDEF) - IGNORE(VNEED) - define(`IGNORE_LWORD', 1)', - `') - define(IGNORE_BYTE, 1) /* 'lator, leave 'em bytes alone */ define(IGNORE_NOTE, 1) define(IGNORE_SXWORD32, 1) @@ -455,7 +447,8 @@ libelf_cvt$3_$1_tom(char *dst, char *src, size_t count, int byteswap) */ define(`MAKE_TYPE_CONVERTER', - `ifdef(`BASE'_$1, + `#if __FreeBSD_version >= $3 /* $1 */ +ifdef(`BASE'_$1, `ifdef(`IGNORE_'$1,`', `MAKEPRIM_TO_F($1,$2,`',64) MAKEPRIM_TO_M($1,$2,`',64)')', @@ -467,7 +460,9 @@ define(`MAKE_TYPE_CONVERTER', `MAKE_TO_F($1,$2,32)dnl MAKE_TO_F($1,$2,64)dnl MAKE_TO_M($1,$2,32)dnl - MAKE_TO_M($1,$2,64)')')') + MAKE_TO_M($1,$2,64)')') +#endif /* $1 */ +') define(`MAKE_TYPE_CONVERTERS', `ifelse($#,1,`', @@ -618,9 +613,11 @@ define(`CONV', `.$3$2 = libelf_cvt$2_$1_$3')')')') define(`CONVERTER_NAME', - `[ELF_T_$1] = { + `#if __FreeBSD_version >= $3 + [ELF_T_$1] = { CONV($1,32,tof), CONV($1,32,tom), CONV($1,64,tof), CONV($1,64,tom) }, +#endif ')') define(`CONVERTER_NAMES', |