一、ELF 部分
1.1 types.h
1.1.1 typedef
这是 types.h
文件,主要是给一些基本的数据类型起一个简单一点的别名。
#ifndef _INC_TYPES_H_
#define _INC_TYPES_H_
#ifndef NULL
#define NULL ((void *) 0)
#endif
typedef unsigned char u_int8_t;
typedef short int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
typedef long long int64_t;
typedef unsigned long long u_int64_t;
typedef int32_t register_t;
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef u_int64_t u_quad_t;
typedef int64_t quad_t;
typedef quad_t * qaddr_t;
#define MIN(_a, _b) \
({ \
typeof(_a) __a = (_a); \
typeof(_b) __b = (_b); \
__a <= __b ? __a : __b; \
})
#define static_assert(c) switch (c) case 0: case(c):
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
#define ROUND(a, n) (((((u_long)(a))+(n)-1)) & ~((n)-1))
#define ROUNDDOWN(a, n) (((u_long)(a)) & ~((n)-1))
#endif