From d52de1054d212814221d1e1c9b70532908a7ce65 Mon Sep 17 00:00:00 2001 From: etheisen <> Date: Mon, 29 Apr 1996 00:54:15 +0000 Subject: [PATCH] Added section header type SHT_OPENBSD - value 0xffffffff, section header name ELF_OPENBSD - value ".openbsd", and elf_hash() prototype in preparation for Per's import of the ELF RTLD. Every OpenBSD ELF bin/so should contain a "empty" section header of type SHT_OPENBSD, and this string ".openbsd" in the .dynstr section. This will allow us to determine the exe/lib's target OS. Note that use of SHT_OPENBSD and ELF_OPENBSD is not ABI compliant. GNU binutils will require mods to met this goal. The relocation settings are now re-enabled. --- src/include/elf_abi.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/include/elf_abi.h b/src/include/elf_abi.h index f5c20f7c..e0878e9d 100644 --- a/src/include/elf_abi.h +++ b/src/include/elf_abi.h @@ -1,11 +1,12 @@ -/* $Id: elf_abi.h,v 1.2 1996/02/15 07:38:14 etheisen Exp $ */ +/* $Id: elf_abi.h,v 1.3 1996/04/29 00:54:15 etheisen Exp $ */ /* - * Copyright (c) 1995 Erik Theisen + * Copyright (c) 1995, 1996 Erik Theisen * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions - * are met: * 1. Redistributions of source code must retain the above copyright + * are met: + * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -170,7 +171,9 @@ typedef struct { #define SHT_REL 9 /* relation section without addends */ #define SHT_SHLIB 10 /* reserved - purpose unknown */ #define SHT_DYNSYM 11 /* dynamic symbol table section */ -#define SHT_NUM 12 /* number of section types */ +#define SHT_OPENBSD 0xffffffff /* OpenBSD hack to determine targ OS */ + /* - This is NOT ABI compliant!!! */ +#define SHT_NUM 13 /* number of section types */ #define SHT_LOPROC 0x70000000 /* reserved range for processor */ #define SHT_HIPROC 0x7fffffff /* specific section header types */ #define SHT_LOUSER 0x80000000 /* reserved range for application */ @@ -198,6 +201,8 @@ typedef struct { #define ELF_STRTAB ".strtab" /* string table */ #define ELF_SYMTAB ".symtab" /* symbol table */ #define ELF_TEXT ".text" /* code */ +#define ELF_OPENBSD ".openbsd" /* OpenBSD hack to determine targ OS */ + /* - This is NOT ABI compliant!!! */ /* Section Attribute Flags - sh_flags */ #define SHF_WRITE 0x1 /* Writable */ @@ -293,9 +298,6 @@ typedef struct { #define PF_MASKPROC 0xf0000000 /* reserved bits for processor */ /* specific segment flags */ - -#if 0 -#error No ELF RTLD support yet /* Dynamic structure */ typedef struct { @@ -337,8 +339,8 @@ extern Elf32_Dyn _DYNAMIC[]; #define DT_JMPREL 23 /* add. of PLT's relocation entries */ #define DT_LOPROC 0x70000000 /* reserved range for processor */ #define DT_HIPROC 0x7fffffff /* specific dynamic array tags */ -#endif - -#endif /* _ELF_ABI_H_ */ +/* Standard ELF hashing function */ +unsigned long elf_hash(const unsigned char *name); +#endif /* _ELF_ABI_H_ */