X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Funexelf.c;h=6ac98448082a95c88b2618b8f7d9cea017cc88dc;hb=6d6da9eb65e98f7f4acaad09969946c7f3f2404b;hp=54c48e107b7899c48e4b9b5fb286f83693f53fba;hpb=82f6d62ee211b1d36e8f45fed3ee3edde82b6916;p=chise%2Fxemacs-chise.git.1 diff --git a/src/unexelf.c b/src/unexelf.c index 54c48e1..6ac9844 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -471,38 +471,16 @@ typedef struct { #define hdrNil ((pHDRR)0) #endif -#ifdef __NetBSD__ -/* - * NetBSD does not have normal-looking user-land ELF support. - */ -# ifdef __alpha__ -# define ELFSIZE 64 -# else -# define ELFSIZE 32 -# endif +#ifdef __OpenBSD__ # include +#endif -# define PT_LOAD Elf_pt_load -# define SHT_SYMTAB Elf_sht_symtab -# define SHT_DYNSYM Elf_sht_dynsym -# define SHT_NULL Elf_sht_null -# define SHT_NOBITS Elf_sht_nobits -# define SHT_REL Elf_sht_rel -# define SHT_RELA Elf_sht_rela - -# define SHN_UNDEF Elf_eshn_undefined -# define SHN_ABS Elf_eshn_absolute -# define SHN_COMMON Elf_eshn_common - -# ifdef __alpha__ -# include -# define HDRR struct ecoff_symhdr -# define pHDRR HDRR * +#if defined(__FreeBSD__) && (defined(__alpha__) || defined(_LP64)) +# ifdef __STDC__ +# define ElfW(type) Elf64_##type +# else +# define ElfW(type) Elf64_/**/type # endif -#endif /* __NetBSD__ */ - -#ifdef __OpenBSD__ -# include #endif #if __GNU_LIBRARY__ - 0 >= 6 @@ -511,10 +489,20 @@ typedef struct { #ifndef ElfW # ifdef __STDC__ -# define ElfW(type) Elf32_##type +# define ElfBitsW(bits, type) Elf##bits##_##type # else -# define ElfW(type) Elf32_/**/type +# define ElfBitsW(bits, type) Elf/**/bits/**/_/**/type +# endif +# ifndef ELFSIZE +# ifdef _LP64 +# define ELFSIZE 64 +# else +# define ELFSIZE 32 +# endif # endif + /* This macro expands `bits' before invoking ElfBitsW. */ +# define ElfExpandBitsW(bits, type) ElfBitsW (bits, type) +# define ElfW(type) ElfExpandBitsW (ELFSIZE, type) #endif #ifndef ELF_BSS_SECTION_NAME