summaryrefslogtreecommitdiff
path: root/patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32
diff options
context:
space:
mode:
Diffstat (limited to 'patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32')
-rw-r--r--patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/100-filter-includes.patch8
-rw-r--r--patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/110-macos-use-local-elf.h.patch57
2 files changed, 61 insertions, 4 deletions
diff --git a/patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/100-filter-includes.patch b/patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/100-filter-includes.patch
index 18bd46a..204aac0 100644
--- a/patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/100-filter-includes.patch
+++ b/patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/100-filter-includes.patch
@@ -1,8 +1,8 @@
-From 74f694a5147089463eecc93034d68278c1fc7561 Mon Sep 17 00:00:00 2001
+From 6ae8f1cc9abd2c25b3376a18f33fee00d9e771cf Mon Sep 17 00:00:00 2001
From: Alexey Neyman <stilor@att.net>
Date: Mon, 27 Feb 2017 01:20:10 -0800
-Subject: [PATCH] When looking for binutils/BFD headers, create a local include
- dir
+Subject: [PATCH 1/2] When looking for binutils/BFD headers, create a local
+ include dir
... and filter only those headers that elf2flt binaries are going
to use, to minimize the chance of clashes with system headers.
@@ -17,7 +17,7 @@ Signed-off-by: Alexey Neyman <stilor@att.net>
create mode 100755 mk-local-include.sh
diff --git a/Makefile.in b/Makefile.in
-index a6feea6..d3e75bd 100644
+index a6feea6..1e34bda 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,7 +14,9 @@ CPU = @target_cpu@
diff --git a/patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/110-macos-use-local-elf.h.patch b/patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/110-macos-use-local-elf.h.patch
new file mode 100644
index 0000000..b189b69
--- /dev/null
+++ b/patches/elf2flt/4820f0dbb77cd6564d5fa0817218fe2a1fb99f32/110-macos-use-local-elf.h.patch
@@ -0,0 +1,57 @@
+From 1c19bf8cc294e95c8de314cc457bcea6854c3a2d Mon Sep 17 00:00:00 2001
+From: Alexey Neyman <stilor@att.net>
+Date: Tue, 28 Feb 2017 09:29:21 -0800
+Subject: [PATCH 2/2] Macos does not have <elf.h> and needs a local copy
+
+Also, move <elf/xtensa.h> up - generic <elf.h> does not have
+definitions for xtensa relocations.
+
+Local file, cygwin-elf.h, needs to include <stdint.h> for standard
+integer types which is POSIX - rather than glibc-originated <features.h>.
+
+Signed-off-by: Alexey Neyman <stilor@att.net>
+---
+ cygwin-elf.h | 2 +-
+ elf2flt.c | 7 +++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/cygwin-elf.h b/cygwin-elf.h
+index bd72b37..8e3dbff 100644
+--- a/cygwin-elf.h
++++ b/cygwin-elf.h
+@@ -26,7 +26,7 @@ typedef uint16_t u_int16_t;
+ typedef uint32_t u_int32_t;
+ typedef uint64_t u_int64_t;
+ #else
+-#include <features.h>
++#include <stdint.h>
+ #endif
+ /* Standard ELF types. */
+
+diff --git a/elf2flt.c b/elf2flt.c
+index 08296cf..19a4d4d 100644
+--- a/elf2flt.c
++++ b/elf2flt.c
+@@ -58,14 +58,17 @@ const char *elf2flt_progname;
+ #include <elf/h8.h> /* TARGET_* ELF support for the BFD library */
+ #elif defined(TARGET_arm)
+ #include <elf/arm.h>
+-#elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(TARGET_nios) || defined(TARGET_nios2)
+-#include "cygwin-elf.h" /* Cygwin uses a local copy */
+ #elif defined(TARGET_xtensa)
+ #include <elf/xtensa.h> /* TARGET_* ELF support for the BFD library */
++#elif defined(TARGET_nios) || defined(TARGET_nios2)
++#include "cygwin-elf.h" // <elf/nios2.h> does not have R_NIOS_* declarations
+ #elif defined(TARGET_microblaze)
+ #include <elf/microblaze.h> /* TARGET_* ELF support for the BFD library */
+ #elif defined(TARGET_v850)
+ #include <elf/v850.h>
++#elif (__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)
++// FIXME: does Cygwin need this? It has <elf.h> in /usr/include
++#include "cygwin-elf.h" // Some systems don't have <elf.h>
+ #else
+ #include <elf.h> /* TARGET_* ELF support for the BFD library */
+ #endif
+--
+2.9.3
+