Gentoo Archives: gentoo-commits

From: "Anthony G. Basile (blueness)" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-util/elfkickers/files: add-freebsd-elf-defs.patch
Date: Tue, 06 Sep 2011 13:20:51
Message-Id: 20110906132040.2D7C420051@flycatcher.gentoo.org
1 blueness 11/09/06 13:20:40
2
3 Added: add-freebsd-elf-defs.patch
4 Log:
5 Patch for missing ELF defs on FreeBSD, bug #380085
6
7 (Portage version: 2.1.10.11/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 dev-util/elfkickers/files/add-freebsd-elf-defs.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/elfkickers/files/add-freebsd-elf-defs.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/elfkickers/files/add-freebsd-elf-defs.patch?rev=1.1&content-type=text/plain
14
15 Index: add-freebsd-elf-defs.patch
16 ===================================================================
17 --- ./elfrw/elfrw.h.orig 2011-05-31 01:47:08.000000000 +0200
18 +++ ./elfrw/elfrw.h 2011-06-08 12:16:37.000000000 +0200
19 @@ -10,6 +10,24 @@
20 #include <stdio.h>
21 #include <elf.h>
22
23 +#ifdef __FreeBSD__
24 +typedef uint16_t Elf64_Section;
25 +
26 +#define PT_GNU_STACK 0x6474e551
27 +#define PT_GNU_RELRO 0x6474e552
28 +
29 +#if __FreeBSD_version < 700022
30 +#define SHT_GNU_HASH 0x6ffffff6
31 +#define EM_CRIS 76
32 +#define EM_M32R 88
33 +#define EM_MN10300 89
34 +#endif
35 +
36 +#define ELFCLASSNUM 3
37 +#define ELFDATANUM 3
38 +#define EV_NUM 2
39 +#endif
40 +
41 /*
42 * The initialization functions. Call one of these to set the flavor
43 * of ELF structures to translate to and from. The library can be
44 --- ./elftoc/readelf.h.orig 2011-05-22 20:46:29.000000000 +0200
45 +++ ./elftoc/readelf.h 2011-06-08 12:16:37.000000000 +0200
46 @@ -7,6 +7,12 @@
47 #ifndef _readelf_h_
48 #define _readelf_h_
49
50 +#ifdef __FreeBSD__
51 +#define ELFCLASSNUM 3
52 +#define ELFDATANUM 3
53 +#define EV_NUM 2
54 +#endif
55 +
56 /* Read all of the basic headers from the file image (namely the ELF
57 * header, the program segment header table, and the section header
58 * table). False is returned if the file could not be parsed as an ELF
59 --- ./elftoc/pieces.c.orig 2011-05-26 03:25:14.000000000 +0200
60 +++ ./elftoc/pieces.c 2011-06-08 12:16:37.000000000 +0200
61 @@ -16,6 +16,10 @@
62 #include "out.h"
63 #include "pieces.h"
64
65 +#ifdef __FreeBSD__
66 +typedef uint64_t Elf32_Xword;
67 +#endif
68 +
69 /* Flags used to insert warnings in the generated source code.
70 */
71 #define PW_MISALIGNED 0x0001 /* piece misaligned for original type */
72 --- ./elftoc/outbase.h.orig 2011-05-22 20:46:29.000000000 +0200
73 +++ ./elftoc/outbase.h 2011-06-08 12:16:37.000000000 +0200
74 @@ -7,6 +7,10 @@
75 #ifndef _outbase_h_
76 #define _outbase_h_
77
78 +#ifdef __FreeBSD__
79 +#define NT_AUXV 6
80 +#endif
81 +
82 /* Set the current output file. Call this before calling any output
83 * functions. (The FILE* argument is given as a void* so as to not
84 * include stdio.h here.)