]> git.wh0rd.org - patches.git/blob - binutils-gas-obj-fdpicelf-2.patch
initial import
[patches.git] / binutils-gas-obj-fdpicelf-2.patch
1 Index: Makefile.am
2 ===================================================================
3 RCS file: /cvs/src/src/gas/Makefile.am,v
4 retrieving revision 1.156
5 diff -u -p -r1.156 Makefile.am
6 --- Makefile.am 13 Mar 2008 02:05:20 -0000 1.156
7 +++ Makefile.am 22 Apr 2008 20:47:23 -0000
8 @@ -364,6 +364,7 @@ OBJ_FORMAT_CFILES = \
9 config/obj-ecoff.c \
10 config/obj-elf.c \
11 config/obj-evax.c \
12 + config/obj-fdpicelf.c \
13 config/obj-som.c
14
15 OBJ_FORMAT_HFILES = \
16 @@ -372,6 +373,7 @@ OBJ_FORMAT_HFILES = \
17 config/obj-ecoff.h \
18 config/obj-elf.h \
19 config/obj-evax.h \
20 + config/obj-fdpicelf.h \
21 config/obj-som.h
22
23 # Emulation header files in config
24 @@ -586,6 +588,8 @@ obj-elf.o : $(srcdir)/config/obj-elf.c $
25 $(COMPILE) -c $(srcdir)/config/obj-elf.c
26 obj-evax.o : $(srcdir)/config/obj-evax.c
27 $(COMPILE) -c $(srcdir)/config/obj-evax.c
28 +obj-fdpicelf.o : $(srcdir)/config/obj-fdpicelf.c
29 + $(COMPILE) -c $(srcdir)/config/obj-fdpicelf.c
30 obj-multi.o : $(srcdir)/config/obj-multi.c
31 $(COMPILE) -c $(srcdir)/config/obj-multi.c
32 obj-som.o : $(srcdir)/config/obj-som.c
33 Index: Makefile.in
34 ===================================================================
35 RCS file: /cvs/src/src/gas/Makefile.in,v
36 retrieving revision 1.173
37 diff -u -p -r1.173 Makefile.in
38 --- Makefile.in 17 Mar 2008 22:17:29 -0000 1.173
39 +++ Makefile.in 22 Apr 2008 20:47:27 -0000
40 @@ -608,6 +608,7 @@ OBJ_FORMAT_CFILES = \
41 config/obj-ecoff.c \
42 config/obj-elf.c \
43 config/obj-evax.c \
44 + config/obj-fdpicelf.c \
45 config/obj-som.c
46
47 OBJ_FORMAT_HFILES = \
48 @@ -616,6 +617,7 @@ OBJ_FORMAT_HFILES = \
49 config/obj-ecoff.h \
50 config/obj-elf.h \
51 config/obj-evax.h \
52 + config/obj-fdpicelf.h \
53 config/obj-som.h
54
55
56 @@ -2586,6 +2588,8 @@ obj-elf.o : $(srcdir)/config/obj-elf.c $
57 $(COMPILE) -c $(srcdir)/config/obj-elf.c
58 obj-evax.o : $(srcdir)/config/obj-evax.c
59 $(COMPILE) -c $(srcdir)/config/obj-evax.c
60 +obj-fdpicelf.o : $(srcdir)/config/obj-fdpicelf.c
61 + $(COMPILE) -c $(srcdir)/config/obj-fdpicelf.c
62 obj-multi.o : $(srcdir)/config/obj-multi.c
63 $(COMPILE) -c $(srcdir)/config/obj-multi.c
64 obj-som.o : $(srcdir)/config/obj-som.c
65 Index: configure.tgt
66 ===================================================================
67 RCS file: /cvs/src/src/gas/configure.tgt,v
68 retrieving revision 1.39
69 diff -u -p -r1.39 configure.tgt
70 --- configure.tgt 1 Feb 2008 17:58:47 -0000 1.39
71 +++ configure.tgt 22 Apr 2008 20:47:27 -0000
72 @@ -125,8 +125,11 @@ case ${generic_target} in
73 arm-*-riscix*) fmt=aout em=riscix ;;
74
75 avr-*-*) fmt=elf bfd_gas=yes ;;
76 - bfin-*-*) fmt=elf bfd_gas=yes ;;
77 +
78 + bfin-*-linux-uclibc) fmt=fdpicelf em=linux ;;
79 + bfin-*-uclinux*) fmt=elf em=linux ;;
80 bfin-*elf) fmt=elf ;;
81 +
82 cr16-*-elf*) fmt=elf ;;
83
84 cris-*-linux-* | crisv32-*-linux-*)
85 @@ -416,7 +419,7 @@ case ${cpu_type} in
86 ;;
87 esac
88 case ${fmt} in
89 - elf | ecoff | multi | som)
90 + elf | ecoff | fdpicelf | multi | som)
91 bfd_gas=yes
92 ;;
93 esac
94 Index: config/obj-fdpicelf.c
95 ===================================================================
96 RCS file: config/obj-fdpicelf.c
97 diff -N config/obj-fdpicelf.c
98 --- /dev/null 1 Jan 1970 00:00:00 -0000
99 +++ config/obj-fdpicelf.c 22 Apr 2008 20:47:27 -0000
100 @@ -0,0 +1 @@
101 +#include "obj-elf.c"
102 Index: config/obj-fdpicelf.h
103 ===================================================================
104 RCS file: config/obj-fdpicelf.h
105 diff -N config/obj-fdpicelf.h
106 --- /dev/null 1 Jan 1970 00:00:00 -0000
107 +++ config/obj-fdpicelf.h 22 Apr 2008 20:47:27 -0000
108 @@ -0,0 +1,2 @@
109 +#define OBJ_FDPIC_ELF 1
110 +#include "obj-elf.h"
111 Index: config/tc-bfin.c
112 ===================================================================
113 RCS file: /cvs/src/src/gas/config/tc-bfin.c,v
114 retrieving revision 1.15
115 diff -u -p -r1.15 tc-bfin.c
116 --- config/tc-bfin.c 26 Mar 2008 16:33:33 -0000 1.15
117 +++ config/tc-bfin.c 22 Apr 2008 20:47:28 -0000
118 @@ -50,8 +50,14 @@ FILE *errorf;
119 /* Flags to set in the elf header */
120 #define DEFAULT_FLAGS 0
121
122 -static flagword bfin_flags = DEFAULT_FLAGS;
123 -static const char *bfin_pic_flag = (const char *)0;
124 +#ifdef OBJ_FDPIC_ELF
125 +# define DEFAULT_FDPIC EF_BFIN_FDPIC
126 +#else
127 +# define DEFAULT_FDPIC 0
128 +#endif
129 +
130 +static flagword bfin_flags = DEFAULT_FLAGS | DEFAULT_FDPIC;
131 +static const char *bfin_pic_flag = DEFAULT_FDPIC ? "-mfdpic" : (const char *)0;
132
133 /* Registers list. */
134 struct bfin_reg_entry
135 @@ -305,10 +311,13 @@ const char FLT_CHARS[] = "fFdDxX";
136 const char *md_shortopts = "";
137
138 #define OPTION_FDPIC (OPTION_MD_BASE)
139 +#define OPTION_NOPIC (OPTION_MD_BASE + 1)
140
141 struct option md_longopts[] =
142 {
143 - { "mfdpic", no_argument, NULL, OPTION_FDPIC },
144 + { "mfdpic", no_argument, NULL, OPTION_FDPIC },
145 + { "mnopic", no_argument, NULL, OPTION_NOPIC },
146 + { "mno-fdpic", no_argument, NULL, OPTION_NOPIC },
147 { NULL, no_argument, NULL, 0 },
148 };
149
150 @@ -327,6 +336,11 @@ md_parse_option (int c ATTRIBUTE_UNUSED,
151 bfin_flags |= EF_BFIN_FDPIC;
152 bfin_pic_flag = "-mfdpic";
153 break;
154 +
155 + case OPTION_NOPIC:
156 + bfin_flags &= ~(EF_BFIN_FDPIC);
157 + bfin_pic_flag = 0;
158 + break;
159 }
160
161 return 1;