1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Small updates according to latest glibc headers.

committer: mfx <mfx> 1126184484 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2005-09-08 13:01:24 +00:00
parent 24ffaa0738
commit 14d303d331
3 changed files with 20 additions and 13 deletions

View File

@ -224,7 +224,7 @@ upx_bzero(char *p, size_t len)
static void static void
__attribute__((regparm(3), stdcall)) __attribute__((regparm(3), stdcall))
auxv_up(Elf32_auxv_t *av, int const type, unsigned const value) auxv_up(Elf32_auxv_t *av, unsigned const type, unsigned const value)
{ {
if (av && 0==(1&(int)av)) /* PT_INTERP usually inhibits, except for hatch */ if (av && 0==(1&(int)av)) /* PT_INTERP usually inhibits, except for hatch */
for (;; ++av) { for (;; ++av) {

View File

@ -219,7 +219,7 @@ upx_bzero(char *p, size_t len)
static void static void
__attribute__((regparm(3), stdcall)) __attribute__((regparm(3), stdcall))
auxv_up(Elf32_auxv_t *av, int const type, unsigned const value) auxv_up(Elf32_auxv_t *av, unsigned const type, unsigned const value)
{ {
if (av && 0==(1&(int)av)) /* PT_INTERP usually inhibits, except for hatch */ if (av && 0==(1&(int)av)) /* PT_INTERP usually inhibits, except for hatch */
for (;; ++av) { for (;; ++av) {

View File

@ -43,7 +43,10 @@ typedef unsigned char uint8_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef int int32_t; typedef int int32_t;
typedef unsigned uint32_t; typedef unsigned uint32_t;
#if defined(_WIN32) && !defined(__GNUC__) #if defined(__GNUC__)
__extension__ typedef long long int64_t;
__extension__ typedef unsigned long long uint64_t;
#elif defined(_WIN32)
typedef __int64 int64_t; typedef __int64 int64_t;
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
#else #else
@ -73,12 +76,15 @@ struct timespec {
// misc constants // misc constants
#if defined(__amd64__) || defined(__powerpc64__)
#elif defined(__i386__) || defined(__powerpc__)
#define PAGE_MASK (~0ul<<12) // discards the offset, keeps the page
#define PAGE_SIZE ( 1ul<<12)
#endif
#define SEEK_SET 0 #define SEEK_SET 0
#define SEEK_CUR 1 #define SEEK_CUR 1
#define PAGE_MASK (~0u<<12) // discards the offset, keeps the page
#define PAGE_SIZE ( 1u<<12)
#define O_RDONLY 00 #define O_RDONLY 00
#define O_WRONLY 01 #define O_WRONLY 01
#define O_RDWR 02 #define O_RDWR 02
@ -94,12 +100,10 @@ struct timespec {
#define F_SETFD 2 #define F_SETFD 2
#define FD_CLOEXEC 1 #define FD_CLOEXEC 1
// <errno.h> // <errno.h>
#define ENOENT 2 #define ENOENT 2
#define EINTR 4 #define EINTR 4
// <sys/mman.h> // <sys/mman.h>
#define PROT_READ 0x1 #define PROT_READ 0x1
#define PROT_WRITE 0x2 #define PROT_WRITE 0x2
@ -112,7 +116,8 @@ struct timespec {
#define MAP_ANONYMOUS 0x20 #define MAP_ANONYMOUS 0x20
#ifdef __i386__ /*{*/ #if defined(__i386__) /*{*/
// <asm/unistd.h> // <asm/unistd.h>
#define __NR_exit 1 #define __NR_exit 1
#define __NR_fork 2 #define __NR_fork 2
@ -328,6 +333,7 @@ static inline _syscall1(int,unlink,const char *,file)
#undef Z1 #undef Z1
#else /*}{ generic */ #else /*}{ generic */
extern void *brk(void *); extern void *brk(void *);
extern int close(int); extern int close(int);
extern void *mmap(void *, size_t, int, int, int, off_t); extern void *mmap(void *, size_t, int, int, int, off_t);
@ -335,7 +341,10 @@ extern int munmap(void *, size_t);
extern int mprotect(void const *, size_t, int); extern int mprotect(void const *, size_t, int);
extern int open(char const *, unsigned, unsigned); extern int open(char const *, unsigned, unsigned);
extern size_t read(int, void *, size_t); extern size_t read(int, void *, size_t);
#endif /*}*/ #endif /*}*/
/************************************************************************* /*************************************************************************
// <elf.h> // <elf.h>
**************************************************************************/ **************************************************************************/
@ -394,11 +403,9 @@ typedef struct
typedef struct typedef struct
{ {
int a_type; uint32_t a_type;
union { union {
long a_val; uint32_t a_val;
void *a_ptr;
void (*a_fcn) (void);
} a_un; } a_un;
} Elf32_auxv_t; } Elf32_auxv_t;