[klibc] more elf defines
Thayne Harbaugh
tharbaugh at lnxi.com
Thu Oct 21 17:44:41 PDT 2004
Add several values and macros to elf32.h, elf64.h and elfcommon.h:
diff -uNr klibc-0.188/include/sys/elf32.h udev-040/klibc-0.188/include/sys/elf32.h
--- klibc-0.188/include/sys/elf32.h 2004-01-30 14:40:51.000000000 -0700
+++ udev-040/klibc-0.188/include/sys/elf32.h 2004-10-21 14:07:48.803164976 -0600
@@ -7,6 +7,10 @@
#include <sys/elfcommon.h>
+#define ELF32_ST_BIND(val) ST_BIND(val)
+#define ELF32_ST_TYPE(val) ST_TYPE(val)
+#define ELF32_ST_INFO(bind, type) ST_INFO((bind), (type))
+
/* ELF standard typedefs (yet more proof that <stdint.h> was way overdue) */
typedef uint16_t Elf32_Half;
typedef int16_t Elf32_SHalf;
diff -uNr klibc-0.188/include/sys/elf64.h udev-040/klibc-0.188/include/sys/elf64.h
--- klibc-0.188/include/sys/elf64.h 2004-01-30 14:40:51.000000000 -0700
+++ udev-040/klibc-0.188/include/sys/elf64.h 2004-10-21 14:08:57.718688224 -0600
@@ -7,6 +7,10 @@
#include <sys/elfcommon.h>
+#define ELF64_ST_BIND(val) ST_BIND(val)
+#define ELF64_ST_TYPE(val) ST_TYPE(val)
+#define ELF64_ST_INFO(bind, type) ST_INFO((bind), (type))
+
/* ELF standard typedefs (yet more proof that <stdint.h> was way overdue) */
typedef uint16_t Elf64_Half;
typedef int16_t Elf64_SHalf;
diff -uNr klibc-0.188/include/sys/elfcommon.h udev-040/klibc-0.188/include/sys/elfcommon.h
--- klibc-0.188/include/sys/elfcommon.h 2004-09-20 08:58:40.000000000 -0600
+++ udev-040/klibc-0.188/include/sys/elfcommon.h 2004-10-21 13:59:51.059793008 -0600
@@ -184,5 +184,33 @@
#define ELFOSABI_NONE 0
#define ELFOSABI_LINUX 3
+/* How to extract and insert information held in the st_info field. */
+
+#define ST_BIND(val) (((unsigned char) (val)) >> 4)
+#define ST_TYPE(val) ((val) & 0xf)
+#define ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
+
+#define STB_LOCAL 0 /* local symbol */
+#define STB_GLOBAL 1 /* global symbol */
+#define STB_WEAK 2 /* weak symbol */
+#define STB_NUM 3 /* number of defined types */
+#define STB_LOOS 10 /* start OS-specific */
+#define STB_HIOS 12 /* end OS-specific */
+#define STB_LOPROC 13 /* start processor-specific */
+#define STB_HIPROC 15 /* end processor-specific */
+
+#define STT_NOTYPE 0 /* symbol type unspecified */
+#define STT_OBJECT 1 /* symbol is data object */
+#define STT_FUNC 2 /* symbol is code object */
+#define STT_SECTION 3 /* symbol associated with section */
+#define STT_FILE 4 /* symbol name is file name */
+#define STT_COMMON 5 /* symbol is common data object */
+#define STT_TLS 6 /* symbol is thread-local data object*/
+#define STT_NUM 7 /* number of defined types */
+#define STT_LOOS 10 /* begin OS-specific */
+#define STT_HIOS 12 /* end OS-specific */
+#define STT_LOPROC 13 /* begin processor-specific */
+#define STT_HIPROC 15 /* end processor-specific */
+
#endif /* _SYS_ELFCOMMON_H */
--
Thayne Harbaugh
Linux Networx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.zytor.com/pipermail/klibc/attachments/20041021/572161ca/attachment.bin
More information about the klibc
mailing list