diff options
author | 2005-10-13 01:53:55 +0000 | |
---|---|---|
committer | 2005-10-13 01:53:55 +0000 | |
commit | 3aa3572daf58263aeba04de89f0a316cbdc36d54 (patch) | |
tree | 5da9503028c3687ce33f53e138780c02ca63a253 /paxelf.h | |
parent | touchup output of TEXTREL matches and update the format help output (diff) | |
download | pax-utils-3aa3572daf58263aeba04de89f0a316cbdc36d54.tar.gz pax-utils-3aa3572daf58263aeba04de89f0a316cbdc36d54.tar.bz2 pax-utils-3aa3572daf58263aeba04de89f0a316cbdc36d54.zip |
split common non-elf features into paxinc.[ch]
Diffstat (limited to 'paxelf.h')
-rw-r--r-- | paxelf.h | 44 |
1 files changed, 1 insertions, 43 deletions
@@ -1,7 +1,7 @@ /* * Copyright 2005 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.35 2005/09/30 03:30:19 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxelf.h,v 1.36 2005/10/13 01:53:55 vapier Exp $ * * Copyright 2005 Ned Ludd - <solar@gentoo.org> * Copyright 2005 Mike Frysinger - <vapier@gentoo.org> @@ -12,29 +12,6 @@ #ifndef _PAX_ELF_H #define _PAX_ELF_H -#include "porting.h" - -#ifndef VERSION -# define VERSION "cvs" -#endif - -extern char do_reverse_endian; -/* Get a value 'X' in the elf header, compensating for endianness. */ -#define EGET(X) \ - (__extension__ ({ \ - uint64_t __res; \ - if (!do_reverse_endian) { __res = (X); \ - } else if (sizeof(X) == 1) { __res = (X); \ - } else if (sizeof(X) == 2) { __res = bswap_16((X)); \ - } else if (sizeof(X) == 4) { __res = bswap_32((X)); \ - } else if (sizeof(X) == 8) { __res = bswap_64((X)); \ - } else { \ - fprintf(stderr, "EGET failed ;(\n"); \ - exit(EXIT_FAILURE); \ - } \ - __res; \ - })) - typedef struct { void *ehdr; void *phdr; @@ -76,25 +53,6 @@ extern const char *get_elfshttype(int type); extern const char *get_elfstttype(int type); extern void *elf_findsecbyname(elfobj *elf, const char *name); -/* helper functions for showing errors */ -#define color 1 -#define COLOR(c,b) (color ? "\e[" c ";" b "m" : "") -#define NORM COLOR("00", "00") -#define RED COLOR("31", "01") -#define YELLOW COLOR("33", "01") - -/* we need the space before the last comma or we trigger a bug in gcc-2 :( */ -#define warn(fmt, args...) \ - fprintf(stderr, "%s%s%s: " fmt "\n", RED, argv0, NORM , ## args) -#define warnf(fmt, args...) warn("%s%s%s(): " fmt, YELLOW, __FUNCTION__, NORM , ## args) -#define _err(wfunc, fmt, args...) \ - do { \ - wfunc(fmt, ## args); \ - exit(EXIT_FAILURE); \ - } while (0) -#define err(fmt, args...) _err(warn, fmt, ## args) -#define errf(fmt, args...) _err(warnf, fmt, ## args) - /* PaX flags (to be read in elfhdr.e_flags) */ #define HF_PAX_PAGEEXEC 1 /* 0: Paging based non-exec pages */ #define HF_PAX_EMUTRAMP 2 /* 0: Emulate trampolines */ |