-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinutils-2.23.diff
116 lines (102 loc) · 3.73 KB
/
binutils-2.23.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
patch against binutils-2.23 in order to enable building the
libbfd, libiberty and libopcodes libraries for an RTEMS host:
o unneeded 'getopt' from libiberty -- it would actually
clash with what's already in newlib/rtems.
o do not install libiberty into a multilib subdirectory.
No other part of binutils can be built as multilibs
and the 'strange' install location of libiberty will
confuse application makefiles which expects it in the
same place where libbfd etc. reside.
o omit a few details from ppc disassembler when building
with pmbfd.
o bugfix in coffcode.h: Need to include <bfd_stdint.h>
To apply this patch, chdir to the directory containing binutils-2.23
and issue (it is always a good idea to run with the --dry-run option first)
patch -p0 -b < <this file>
Till Straumann, 1/2013
*** binutils-2.23/libiberty/getopt.c.orig 2013-01-17 13:25:50.184066036 -0800
--- binutils-2.23/libiberty/getopt.c 2013-01-17 13:26:16.807302850 -0800
***************
*** 61,66 ****
--- 61,73 ----
# endif
#endif
+ /* newlibc provides getopt but I have no easy way to check for newlib.
+ * However, we know that rtems uses newlib...
+ */
+ #ifdef __rtems__
+ #define ELIDE_CODE
+ #endif
+
#ifndef ELIDE_CODE
*** binutils-2.23/libiberty/getopt1.c.orig 2013-01-17 13:26:49.174374774 -0800
--- binutils-2.23/libiberty/getopt1.c 2013-01-17 13:27:13.857666850 -0800
***************
*** 52,57 ****
--- 52,64 ----
#endif
#endif
+ /* newlibc provides getopt but I have no easy way to check for newlib.
+ * However, we know that rtems uses newlib...
+ */
+ #ifdef __rtems__
+ #define ELIDE_CODE
+ #endif
+
#ifndef ELIDE_CODE
*** binutils-2.23/libiberty/Makefile.in.orig 2013-01-17 12:23:12.851042129 -0800
--- binutils-2.23/libiberty/Makefile.in 2013-01-17 12:49:36.629396030 -0800
***************
*** 352,358 ****
# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
# default multilib, so we have to take CFLAGS into account as well,
# since it will be passed the multilib flags.
! MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
install_to_libdir: all
${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
--- 352,358 ----
# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
# default multilib, so we have to take CFLAGS into account as well,
# since it will be passed the multilib flags.
! MULTIOSDIR =
install_to_libdir: all
${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
*** binutils-2.23/opcodes/ppc-dis.c.orig 2013-01-17 19:06:08.228257752 -0600
--- binutils-2.23/opcodes/ppc-dis.c 2013-01-22 13:26:25.155626576 -0600
***************
*** 23,29 ****
--- 23,31 ----
#include "sysdep.h"
#include <stdio.h>
#include "dis-asm.h"
+ #ifndef _PMBFD_
#include "elf-bfd.h"
+ #endif
#include "elf/ppc.h"
#include "opintl.h"
#include "opcode/ppc.h"
***************
*** 199,207 ****
--- 201,211 ----
/* Disassemble according to the section headers flags for VLE-mode. */
if (dialect & PPC_OPCODE_VLE
+ #ifndef _PMBFD_
&& info->section->owner != NULL
&& bfd_get_flavour (info->section->owner) == bfd_target_elf_flavour
&& elf_object_id (info->section->owner) == PPC32_ELF_DATA
+ #endif
&& (elf_section_flags (info->section) & SHF_PPC_VLE) != 0)
return dialect;
else
*** binutils-2.23/bfd/coffcode.h.orig 2013-01-28 11:00:21.489846961 -0800
--- binutils-2.23/bfd/coffcode.h 2013-01-28 11:00:32.647429277 -0800
***************
*** 362,367 ****
--- 362,368 ----
*/
#include "libiberty.h"
+ #include "bfd_stdint.h"
#ifdef COFF_WITH_PE
#include "peicode.h"