kernel: fix sanity check
[minix.git] / external / gpl3 / binutils / patches / 0000-binutils_nbsd.patch
bloba1edeebf8e99303e16cf1a743e3c7af65ef8407a
1 diff -rNU3 dist/bfd/ChangeLog dist.nbsd/bfd/ChangeLog
2 --- dist/bfd/ChangeLog Wed Nov 7 11:43:32 2012
3 +++ dist.nbsd/bfd/ChangeLog Wed Nov 7 11:13:53 2012
4 @@ -1,3 +1,13 @@
5 +2011-12-11 John Davis Anglin <dave.anglin@nrc-cnrc.gc.ca>
7 + PR binutils/13476
8 + * elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
9 + R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations to
10 + R_PARISC_DPREL21L when not doing a shared link. Likewise convert
11 + R_PARISC_TLS_GD14R, R_PARISC_TLS_LDM14R and R_PARISC_TLS_IE14R to
12 + R_PARISC_DPREL14R. Handle R_PARISC_TLS_GD21L, R_PARISC_TLS_LDM21L
13 + and R_PARISC_TLS_IE21L with R_PARISC_DLTIND21L.
15 2011-06-27 Tristan Gingold <gingold@adacore.com>
17 * configure.in: Bump version to 2.21.1
18 diff -rNU3 dist/bfd/archive.c dist.nbsd/bfd/archive.c
19 --- dist/bfd/archive.c Wed Nov 7 11:43:32 2012
20 +++ dist.nbsd/bfd/archive.c Wed Nov 7 11:13:53 2012
21 @@ -156,6 +156,9 @@
22 #define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen)
24 #define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data))
26 +static const char * normalize (bfd *, const char *);
28 #define arch_hdr(bfd) ((struct ar_hdr *) arch_eltdata (bfd)->arch_header)
30 /* True iff NAME designated a BSD 4.4 extended name. */
31 @@ -725,7 +728,9 @@
32 /* Pad to an even boundary...
33 Note that last_file->origin can be odd in the case of
34 BSD-4.4-style element with a long odd size. */
35 - filestart += filestart % 2;
36 + if (!strncmp(arch_hdr (last_file)->ar_name, "#1/", 3))
37 + size += strlen(normalize(last_file, last_file->filename));
38 + filestart += size % 2;
41 return _bfd_get_elt_at_filepos (archive, filestart);
42 @@ -2068,11 +2073,22 @@
43 current = current->archive_next)
45 char buffer[DEFAULT_BUFFERSIZE];
46 - unsigned int remaining = arelt_size (current);
47 + unsigned int saved_size = arelt_size (current);
48 + unsigned int remaining = saved_size;
49 + struct ar_hdr *hdr = arch_hdr (current);
51 /* Write ar header. */
52 if (!_bfd_write_ar_hdr (arch, current))
53 return FALSE;
54 + /* Write filename if it is a 4.4BSD extended file, and add to size. */
55 + if (!strncmp (hdr->ar_name, "#1/", 3))
56 + {
57 + const char *normal = normalize (current, current->filename);
58 + unsigned int thislen = strlen (normal);
59 + if (bfd_write (normal, 1, thislen, arch) != thislen)
60 + return FALSE;
61 + saved_size += thislen;
62 + }
63 if (bfd_is_thin_archive (arch))
64 continue;
65 if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0)
66 @@ -2343,11 +2359,11 @@
70 - struct areltdata *ared = arch_eltdata (current);
72 - firstreal += (ared->parsed_size + ared->extra_size
73 - + sizeof (struct ar_hdr));
74 - firstreal += firstreal % 2;
75 + unsigned int size = arelt_size (current);
76 + if (!strncmp(arch_hdr (current)->ar_name, "#1/", 3))
77 + size += strlen(normalize(current, current->filename));
78 + firstreal += size + sizeof (struct ar_hdr);
79 + firstreal += size % 2;
80 current = current->archive_next;
82 while (current != map[count].u.abfd);
83 diff -rNU3 dist/bfd/bfd-in2.h dist.nbsd/bfd/bfd-in2.h
84 --- dist/bfd/bfd-in2.h Wed Nov 7 11:43:32 2012
85 +++ dist.nbsd/bfd/bfd-in2.h Wed Nov 7 11:13:53 2012
86 @@ -5072,6 +5072,11 @@
87 /* This BFD has been created by the linker and doesn't correspond
88 to any input file. */
89 #define BFD_LINKER_CREATED 0x2000
90 + /* This may be set before writing out a BFD to request that it
91 + be written using values for UIDs, GIDs, timestamps, etc. that
92 + will be consistent from run to run. */
93 +#define BFD_DETERMINISTIC_OUTPUT 0x4000
96 /* This may be set before writing out a BFD to request that it
97 be written using values for UIDs, GIDs, timestamps, etc. that
98 diff -rNU3 dist/bfd/coff-alpha.c dist.nbsd/bfd/coff-alpha.c
99 --- dist/bfd/coff-alpha.c Wed Nov 7 11:43:32 2012
100 +++ dist.nbsd/bfd/coff-alpha.c Wed Nov 7 11:13:53 2012
101 @@ -687,7 +687,9 @@
102 case ALPHA_R_OP_STORE:
103 /* The STORE reloc needs the size and offset fields. We store
104 them in the addend. */
105 +#if 0
106 BFD_ASSERT (intern->r_offset <= 256);
107 +#endif
108 rptr->addend = (intern->r_offset << 8) + intern->r_size;
109 break;
111 diff -rNU3 dist/bfd/config.bfd dist.nbsd/bfd/config.bfd
112 --- dist/bfd/config.bfd Wed Nov 7 11:43:32 2012
113 +++ dist.nbsd/bfd/config.bfd Wed Nov 7 11:13:53 2012
114 @@ -218,15 +218,15 @@
116 armeb-*-netbsdelf*)
117 targ_defvec=bfd_elf32_bigarm_vec
118 - targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec"
119 + targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec"
121 arm-*-netbsdelf*)
122 targ_defvec=bfd_elf32_littlearm_vec
123 - targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec"
124 + targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec"
126 arm-*-netbsd* | arm-*-openbsd*)
127 targ_defvec=armnetbsd_vec
128 - targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec"
129 + targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec armcoff_little_vec armcoff_big_vec"
130 targ_underscore=yes
131 targ_cflags=-D__QNXTARGET__
133 @@ -832,9 +832,9 @@
134 # targ_selvecs=m68kmach3_vec
135 # targ_cflags=-DSTAT_FOR_EXEC
137 - m68*-hp*-netbsd*)
138 + m68k4k*-*-netbsd*)
139 targ_defvec=m68k4knetbsd_vec
140 - targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec"
141 + targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec bfd_elf32_m68k_vec"
142 targ_underscore=yes
144 m68*-*-netbsdelf*)
145 @@ -910,6 +910,16 @@
146 targ_defvec=ecoff_big_vec
147 targ_selvecs=ecoff_little_vec
149 +#ifdef BFD64
150 + mips64*el-*-netbsd*)
151 + targ_defvec=bfd_elf32_ntradlittlemips_vec
152 + targ_selvecs="bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec"
153 + ;;
154 + mips64*-*-netbsd*)
155 + targ_defvec=bfd_elf32_ntradbigmips_vec
156 + targ_selvecs="bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec"
157 + ;;
158 +#endif
159 mips*el-*-netbsd*)
160 targ_defvec=bfd_elf32_tradlittlemips_vec
161 targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_little_vec ecoff_big_vec"
162 @@ -1288,6 +1298,8 @@
163 want64=true
166 +#endif
168 sh*l*-*-netbsdelf*)
169 targ_defvec=bfd_elf32_shlnbsd_vec
170 targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
171 @@ -1298,8 +1310,6 @@
172 targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
173 want64=true
175 -#endif
177 sh*-*-netbsdelf*)
178 targ_defvec=bfd_elf32_shnbsd_vec
179 targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
180 @@ -1389,11 +1399,11 @@
182 sparc-*-netbsdelf*)
183 targ_defvec=bfd_elf32_sparc_vec
184 - targ_selvecs=sparcnetbsd_vec
185 + targ_selvecs="sparcnetbsd_vec sunos_big_vec"
187 - sparc-*-netbsdaout* | sparc-*-netbsd*)
188 + sparc-*-netbsd*)
189 targ_defvec=sparcnetbsd_vec
190 - targ_selvecs=bfd_elf32_sparc_vec
191 + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
192 targ_underscore=yes
194 sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1])
195 @@ -1440,6 +1450,10 @@
196 targ_defvec=bfd_elf64_sparc_vec
197 targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
198 want64=true
199 + ;;
200 + sparc64-*-netbsd*)
201 + targ_defvec=bfd_elf64_sparc_vec
202 + targ_selvecs="bfd_elf32_sparc_vec sparcnetbsd_vec sunos_big_vec"
204 sparc64-*-elf* | sparc64-*-rtems* )
205 targ_defvec=bfd_elf64_sparc_vec
206 diff -rNU3 dist/bfd/configure dist.nbsd/bfd/configure
207 --- dist/bfd/configure Wed Nov 7 11:43:32 2012
208 +++ dist.nbsd/bfd/configure Wed Nov 7 11:13:54 2012
209 @@ -12109,10 +12109,10 @@
210 withval=$with_pkgversion; case "$withval" in
211 yes) as_fn_error "package version not specified" "$LINENO" 5 ;;
212 no) PKGVERSION= ;;
213 - *) PKGVERSION="($withval) " ;;
214 + *) PKGVERSION="($withval)\ " ;;
215 esac
216 else
217 - PKGVERSION="(GNU Binutils) "
218 + PKGVERSION="(GNU Binutils)\ "
222 @@ -13850,6 +13850,7 @@
223 COREFILE=netbsd-core.lo
225 arm-*-riscix) COREFILE=trad-core.lo ;;
226 + arm*-*-netbsd*) COREFILE=netbsd-core.lo ;;
227 hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
228 hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
229 hppa*-*-mpeix*) COREFILE=hpux-core.lo ;;
230 @@ -13912,7 +13913,7 @@
231 COREFILE=trad-core.lo
232 TRAD_HEADER='"hosts/i860mach3.h"'
234 - mips-*-netbsd* | mips*-*-openbsd*)
235 + mips*-*-netbsd* | mips*-*-openbsd*)
236 COREFILE=netbsd-core.lo
238 mips-dec-*)
239 diff -rNU3 dist/bfd/configure.host dist.nbsd/bfd/configure.host
240 --- dist/bfd/configure.host Wed Nov 7 11:43:32 2012
241 +++ dist.nbsd/bfd/configure.host Wed Nov 7 11:13:53 2012
242 @@ -56,6 +56,18 @@
244 m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;;
246 +sparc64*-*-netbsd*) host64=true; HOST_64BIT_TYPE=long ;;
248 +x86_64*-*-netbsd*) host64=true; HOST_64BIT_TYPE=long ;;
250 +*-*-aix*) HOST_64BIT_TYPE="long long"
251 + HOST_U_64BIT_TYPE="unsigned long long"
252 + ;;
254 +*-*-solaris*) HOST_64BIT_TYPE="long long"
255 + HOST_U_64BIT_TYPE="unsigned long long"
256 + ;;
258 # Some Solaris systems (osol0906 at least) have a libc that doesn't recognise
259 # the "MS-ANSI" code page name, so we define an override for CP_ACP (sets the
260 # default code page used by windres/windmc when not specified by a commandline
261 diff -rNU3 dist/bfd/configure.in dist.nbsd/bfd/configure.in
262 --- dist/bfd/configure.in Wed Nov 7 11:43:32 2012
263 +++ dist.nbsd/bfd/configure.in Wed Nov 7 11:13:53 2012
264 @@ -242,6 +242,7 @@
265 COREFILE=netbsd-core.lo
267 arm-*-riscix) COREFILE=trad-core.lo ;;
268 + arm*-*-netbsd*) COREFILE=netbsd-core.lo ;;
269 hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
270 hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
271 hppa*-*-mpeix*) COREFILE=hpux-core.lo ;;
272 @@ -328,7 +329,7 @@
273 COREFILE=trad-core.lo
274 TRAD_HEADER='"hosts/i860mach3.h"'
276 - mips-*-netbsd* | mips*-*-openbsd*)
277 + mips*-*-netbsd* | mips*-*-openbsd*)
278 COREFILE=netbsd-core.lo
280 mips-dec-*)
281 diff -rNU3 dist/bfd/doc/Makefile.in dist.nbsd/bfd/doc/Makefile.in
282 --- dist/bfd/doc/Makefile.in Wed Nov 7 11:43:32 2012
283 +++ dist.nbsd/bfd/doc/Makefile.in Wed Nov 7 11:13:53 2012
284 @@ -417,7 +417,9 @@
285 clean-libtool:
286 -rm -rf .libs _libs
288 -bfd.info: bfd.texinfo $(bfd_TEXINFOS)
289 +bfd.info:
290 + @echo "NOT REBUILDING $@"
291 +NetBSD_DISABLED_bfd.info: bfd.texinfo $(bfd_TEXINFOS)
292 restore=: && backupdir="$(am__leading_dot)am$$$$" && \
293 rm -rf $$backupdir && mkdir $$backupdir && \
294 if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
295 diff -rNU3 dist/bfd/doc/bfdver.texi dist.nbsd/bfd/doc/bfdver.texi
296 --- dist/bfd/doc/bfdver.texi Wed Nov 7 11:43:32 2012
297 +++ dist.nbsd/bfd/doc/bfdver.texi Wed Nov 7 11:13:53 2012
298 @@ -1,4 +1,4 @@
299 @set VERSION 2.21.1
300 -@set VERSION_PACKAGE (GNU Binutils)
301 -@set UPDATED June 2011
302 +@set VERSION_PACKAGE (GNU Binutils)\
303 +@set UPDATED September 2011
304 @set BUGURL @uref{http://www.sourceware.org/bugzilla/}
305 diff -rNU3 dist/bfd/doc/reloc.texi dist.nbsd/bfd/doc/reloc.texi
306 --- dist/bfd/doc/reloc.texi Wed Nov 7 11:43:32 2012
307 +++ dist.nbsd/bfd/doc/reloc.texi Wed Nov 7 11:13:53 2012
308 @@ -570,6 +570,12 @@
309 @deffnx {} BFD_RELOC_68K_TLS_LE8
310 Relocations used by 68K ELF.
311 @end deffn
312 +@deffn {} BFD_RELOC_VAX_GLOB_DAT
313 +@deffnx {} BFD_RELOC_VAX_GLOB_REF
314 +@deffnx {} BFD_RELOC_VAX_JMP_SLOT
315 +@deffnx {} BFD_RELOC_VAX_RELATIVE
316 +Relocations used by VAX ELF.
317 +@end deffn
318 @deffn {} BFD_RELOC_32_BASEREL
319 @deffnx {} BFD_RELOC_16_BASEREL
320 @deffnx {} BFD_RELOC_LO16_BASEREL
321 diff -rNU3 dist/bfd/elf.c dist.nbsd/bfd/elf.c
322 --- dist/bfd/elf.c Wed Nov 7 11:43:32 2012
323 +++ dist.nbsd/bfd/elf.c Wed Nov 7 11:13:53 2012
324 @@ -8502,6 +8502,23 @@
325 return TRUE;
328 + /* On SuperH, PT_GETREGS == mach+3 and PT_GETFPREGS == mach+5.
329 + There's also old PT___GETREGS40 == mach + 1 for old reg
330 + structure which lacks GBR. */
332 + case bfd_arch_sh:
333 + switch (note->type)
335 + case NT_NETBSDCORE_FIRSTMACH+3:
336 + return elfcore_make_note_pseudosection (abfd, ".reg", note);
338 + case NT_NETBSDCORE_FIRSTMACH+5:
339 + return elfcore_make_note_pseudosection (abfd, ".reg2", note);
341 + default:
342 + return TRUE;
345 /* On all other arch's, PT_GETREGS == mach+1 and
346 PT_GETFPREGS == mach+3. */
348 diff -rNU3 dist/bfd/elf32-arm.c dist.nbsd/bfd/elf32-arm.c
349 --- dist/bfd/elf32-arm.c Wed Nov 7 11:43:32 2012
350 +++ dist.nbsd/bfd/elf32-arm.c Wed Nov 7 11:13:53 2012
351 @@ -11783,6 +11783,10 @@
353 struct bfd_link_info *info = (struct bfd_link_info *) inf;
355 + if (info->warn_shared_textrel)
356 + (*_bfd_error_handler)
357 + (_("warning: dynamic relocation in readonly section `%s'"),
358 + h->root.root.string);
359 info->flags |= DF_TEXTREL;
361 /* Not an error, just cut short the traversal. */
362 diff -rNU3 dist/bfd/elf32-hppa.c dist.nbsd/bfd/elf32-hppa.c
363 --- dist/bfd/elf32-hppa.c Wed Nov 7 11:43:32 2012
364 +++ dist.nbsd/bfd/elf32-hppa.c Wed Nov 7 11:13:53 2012
365 @@ -2201,6 +2201,10 @@
367 struct bfd_link_info *info = inf;
369 + if (info->warn_shared_textrel)
370 + (*_bfd_error_handler)
371 + (_("warning: dynamic relocation in readonly section `%s'"),
372 + eh->root.root.string);
373 info->flags |= DF_TEXTREL;
375 /* Not an error, just cut short the traversal. */
376 @@ -3352,10 +3356,16 @@
377 switch (r_type)
379 case R_PARISC_DLTIND21L:
380 + case R_PARISC_TLS_GD21L:
381 + case R_PARISC_TLS_LDM21L:
382 + case R_PARISC_TLS_IE21L:
383 r_type = R_PARISC_DPREL21L;
384 break;
386 case R_PARISC_DLTIND14R:
387 + case R_PARISC_TLS_GD14R:
388 + case R_PARISC_TLS_LDM14R:
389 + case R_PARISC_TLS_IE14R:
390 r_type = R_PARISC_DPREL14R;
391 break;
393 @@ -3421,53 +3431,48 @@
394 case R_PARISC_DPREL21L:
395 case R_PARISC_DPREL14R:
396 case R_PARISC_DPREL14F:
397 - case R_PARISC_TLS_GD21L:
398 - case R_PARISC_TLS_LDM21L:
399 - case R_PARISC_TLS_IE21L:
400 /* Convert instructions that use the linkage table pointer (r19) to
401 instructions that use the global data pointer (dp). This is the
402 most efficient way of using PIC code in an incomplete executable,
403 but the user must follow the standard runtime conventions for
404 accessing data for this to work. */
405 - if (orig_r_type == R_PARISC_DLTIND21L
406 - || (!info->shared
407 - && (r_type == R_PARISC_TLS_GD21L
408 - || r_type == R_PARISC_TLS_LDM21L
409 - || r_type == R_PARISC_TLS_IE21L)))
410 + if (orig_r_type != r_type)
412 - /* Convert addil instructions if the original reloc was a
413 - DLTIND21L. GCC sometimes uses a register other than r19 for
414 - the operation, so we must convert any addil instruction
415 - that uses this relocation. */
416 - if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
417 - insn = ADDIL_DP;
418 - else
419 - /* We must have a ldil instruction. It's too hard to find
420 - and convert the associated add instruction, so issue an
421 - error. */
422 - (*_bfd_error_handler)
423 - (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
424 - input_bfd,
425 - input_section,
426 - (long) offset,
427 - howto->name,
428 - insn);
429 + if (r_type == R_PARISC_DPREL21L)
431 + /* GCC sometimes uses a register other than r19 for the
432 + operation, so we must convert any addil instruction
433 + that uses this relocation. */
434 + if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
435 + insn = ADDIL_DP;
436 + else
437 + /* We must have a ldil instruction. It's too hard to find
438 + and convert the associated add instruction, so issue an
439 + error. */
440 + (*_bfd_error_handler)
441 + (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
442 + input_bfd,
443 + input_section,
444 + (long) offset,
445 + howto->name,
446 + insn);
448 + else if (r_type == R_PARISC_DPREL14F)
450 + /* This must be a format 1 load/store. Change the base
451 + register to dp. */
452 + insn = (insn & 0xfc1ffff) | (27 << 21);
455 - else if (orig_r_type == R_PARISC_DLTIND14F)
457 - /* This must be a format 1 load/store. Change the base
458 - register to dp. */
459 - insn = (insn & 0xfc1ffff) | (27 << 21);
462 - /* For all the DP relative relocations, we need to examine the symbol's
463 - section. If it has no section or if it's a code section, then
464 - "data pointer relative" makes no sense. In that case we don't
465 - adjust the "value", and for 21 bit addil instructions, we change the
466 - source addend register from %dp to %r0. This situation commonly
467 - arises for undefined weak symbols and when a variable's "constness"
468 - is declared differently from the way the variable is defined. For
469 - instance: "extern int foo" with foo defined as "const int foo". */
470 + /* For all the DP relative relocations, we need to examine the symbol's
471 + section. If it has no section or if it's a code section, then
472 + "data pointer relative" makes no sense. In that case we don't
473 + adjust the "value", and for 21 bit addil instructions, we change the
474 + source addend register from %dp to %r0. This situation commonly
475 + arises for undefined weak symbols and when a variable's "constness"
476 + is declared differently from the way the variable is defined. For
477 + instance: "extern int foo" with foo defined as "const int foo". */
478 if (sym_sec == NULL || (sym_sec->flags & SEC_CODE) != 0)
480 if ((insn & ((0x3f << 26) | (0x1f << 21)))
481 @@ -3484,6 +3489,9 @@
482 case R_PARISC_DLTIND21L:
483 case R_PARISC_DLTIND14R:
484 case R_PARISC_DLTIND14F:
485 + case R_PARISC_TLS_GD21L:
486 + case R_PARISC_TLS_LDM21L:
487 + case R_PARISC_TLS_IE21L:
488 case R_PARISC_TLS_GD14R:
489 case R_PARISC_TLS_LDM14R:
490 case R_PARISC_TLS_IE14R:
491 diff -rNU3 dist/bfd/elf32-i386.c dist.nbsd/bfd/elf32-i386.c
492 --- dist/bfd/elf32-i386.c Wed Nov 7 11:43:32 2012
493 +++ dist.nbsd/bfd/elf32-i386.c Wed Nov 7 11:13:53 2012
494 @@ -515,7 +515,7 @@
495 /* The name of the dynamic interpreter. This is put in the .interp
496 section. */
498 -#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
499 +#define ELF_DYNAMIC_INTERPRETER "/libexec/ld.elf_so"
501 /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
502 copying dynamic variables from a shared lib into an app's dynbss
503 @@ -2391,7 +2391,10 @@
504 if (s != NULL && (s->flags & SEC_READONLY) != 0)
506 struct bfd_link_info *info = (struct bfd_link_info *) inf;
508 + if (info->warn_shared_textrel)
509 + (*_bfd_error_handler)
510 + (_("warning: dynamic relocation in readonly section `%s'"),
511 + h->root.root.string);
512 info->flags |= DF_TEXTREL;
514 /* Not an error, just cut short the traversal. */
515 diff -rNU3 dist/bfd/elf32-m68k.c dist.nbsd/bfd/elf32-m68k.c
516 --- dist/bfd/elf32-m68k.c Wed Nov 7 11:43:32 2012
517 +++ dist.nbsd/bfd/elf32-m68k.c Wed Nov 7 11:13:54 2012
518 @@ -2567,7 +2567,7 @@
519 if (ind->got_entry_key != 0)
521 BFD_ASSERT (dir->got_entry_key == 0);
522 - /* Assert that GOTs aren't partioned yet. */
523 + /* Assert that GOTs aren't partitioned yet. */
524 BFD_ASSERT (ind->glist == NULL);
526 dir->got_entry_key = ind->got_entry_key;
527 diff -rNU3 dist/bfd/elf32-ppc.c dist.nbsd/bfd/elf32-ppc.c
528 --- dist/bfd/elf32-ppc.c Wed Nov 7 11:43:32 2012
529 +++ dist.nbsd/bfd/elf32-ppc.c Wed Nov 7 11:13:53 2012
530 @@ -3506,7 +3506,7 @@
531 sec->has_tls_get_addr_call = 1;
534 - switch (r_type)
535 + switch ((int)r_type)
537 case R_PPC_TLSGD:
538 case R_PPC_TLSLD:
539 @@ -7219,7 +7219,7 @@
540 howto = NULL;
541 if (r_type < R_PPC_max)
542 howto = ppc_elf_howto_table[r_type];
543 - switch (r_type)
544 + switch ((int)r_type)
546 default:
547 (*_bfd_error_handler)
548 diff -rNU3 dist/bfd/elf32-sh.c dist.nbsd/bfd/elf32-sh.c
549 --- dist/bfd/elf32-sh.c Wed Nov 7 11:43:32 2012
550 +++ dist.nbsd/bfd/elf32-sh.c Wed Nov 7 11:13:53 2012
551 @@ -3333,6 +3333,10 @@
553 struct bfd_link_info *info = (struct bfd_link_info *) inf;
555 + if (info->warn_shared_textrel)
556 + (*_bfd_error_handler)
557 + (_("warning: dynamic relocation in readonly section `%s'"),
558 + h->root.root.string);
559 info->flags |= DF_TEXTREL;
561 /* Not an error, just cut short the traversal. */
562 diff -rNU3 dist/bfd/elf32-vax.c dist.nbsd/bfd/elf32-vax.c
563 --- dist/bfd/elf32-vax.c Wed Nov 7 11:43:32 2012
564 +++ dist.nbsd/bfd/elf32-vax.c Wed Nov 7 11:13:54 2012
565 @@ -52,7 +52,7 @@
567 static bfd_boolean elf32_vax_set_private_flags (bfd *, flagword);
568 static bfd_boolean elf32_vax_merge_private_bfd_data (bfd *, bfd *);
569 -static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, PTR);
570 +static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, void *);
572 static reloc_howto_type howto_table[] = {
573 HOWTO (R_VAX_NONE, /* type */
574 @@ -422,7 +422,7 @@
575 #define elf_vax_link_hash_traverse(table, func, info) \
576 (elf_link_hash_traverse \
577 ((table), \
578 - (bfd_boolean (*) (struct elf_link_hash_entry *, PTR)) (func), \
579 + (bfd_boolean (*) (struct elf_link_hash_entry *, void *)) (func), \
580 (info)))
582 /* Create an entry in an VAX ELF linker hash table. */
583 @@ -489,6 +489,24 @@
584 return TRUE;
587 +/* Copy vax-specific data from one module to another */
588 +static bfd_boolean
589 +elf32_vax_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
591 + flagword in_flags;
593 + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
594 + || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
595 + return TRUE;
597 + in_flags = elf_elfheader (ibfd)->e_flags;
599 + elf_elfheader (obfd)->e_flags = in_flags;
600 + elf_flags_init (obfd) = TRUE;
602 + return TRUE;
605 /* Merge backend specific data from an object file to the output
606 object file when linking. */
607 static bfd_boolean
608 @@ -513,7 +531,7 @@
610 /* Display the flags field */
611 static bfd_boolean
612 -elf32_vax_print_private_bfd_data (bfd *abfd, PTR ptr)
613 +elf32_vax_print_private_bfd_data (bfd *abfd, void * ptr)
615 FILE *file = (FILE *) ptr;
617 @@ -622,14 +640,13 @@
618 srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
619 if (srelgot == NULL)
621 + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
622 + | SEC_IN_MEMORY | SEC_LINKER_CREATED
623 + | SEC_READONLY);
625 srelgot = bfd_make_section_with_flags (dynobj,
626 ".rela.got",
627 - (SEC_ALLOC
628 - | SEC_LOAD
629 - | SEC_HAS_CONTENTS
630 - | SEC_IN_MEMORY
631 - | SEC_LINKER_CREATED
632 - | SEC_READONLY));
633 + flags);
634 if (srelgot == NULL
635 || !bfd_set_section_alignment (dynobj, srelgot, 2))
636 return FALSE;
637 @@ -752,7 +769,13 @@
638 return FALSE;
640 if (sec->flags & SEC_READONLY)
641 - info->flags |= DF_TEXTREL;
643 + if (info->warn_shared_textrel)
644 + (*_bfd_error_handler)
645 + (_("warning: dynamic relocation in readonly section `%s'"),
646 + sec->name);
647 + info->flags |= DF_TEXTREL;
651 sreloc->size += sizeof (Elf32_External_Rela);
652 @@ -933,39 +956,21 @@
653 if (h->type == STT_FUNC
654 || h->needs_plt)
656 - if (! info->shared
657 - && !h->def_dynamic
658 - && !h->ref_dynamic
659 - /* We must always create the plt entry if it was referenced
660 - by a PLTxxO relocation. In this case we already recorded
661 - it as a dynamic symbol. */
662 - && h->dynindx == -1)
663 + if (h->plt.refcount <= 0
664 + || SYMBOL_CALLS_LOCAL (info, h)
665 + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
666 + && h->root.type == bfd_link_hash_undefweak))
668 /* This case can occur if we saw a PLTxx reloc in an input
669 file, but the symbol was never referred to by a dynamic
670 - object. In such a case, we don't actually need to build
671 - a procedure linkage table, and we can just do a PCxx
672 - reloc instead. */
673 - BFD_ASSERT (h->needs_plt);
674 + object, or if all references were garbage collected. In
675 + such a case, we don't actually need to build a procedure
676 + linkage table, and we can just do a PCxx reloc instead. */
677 h->plt.offset = (bfd_vma) -1;
678 - return TRUE;
681 - /* GC may have rendered this entry unused. */
682 - if (h->plt.refcount <= 0)
684 h->needs_plt = 0;
685 - h->plt.offset = (bfd_vma) -1;
686 return TRUE;
689 - /* Make sure this symbol is output as a dynamic symbol. */
690 - if (h->dynindx == -1)
692 - if (! bfd_elf_link_record_dynamic_symbol (info, h))
693 - return FALSE;
696 s = bfd_get_section_by_name (dynobj, ".plt");
697 BFD_ASSERT (s != NULL);
699 @@ -1035,13 +1040,6 @@
700 if (info->shared)
701 return TRUE;
703 - if (h->size == 0)
705 - (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
706 - h->root.root.string);
707 - return TRUE;
710 /* We must allocate the symbol in our .dynbss section, which will
711 become part of the .bss section of the executable. There will be
712 an entry for this symbol in the .dynsym section. The dynamic
713 @@ -1059,7 +1057,7 @@
714 copy the initial value out of the dynamic object and into the
715 runtime process image. We need to remember the offset into the
716 .rela.bss section we are going to use. */
717 - if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
718 + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
720 asection *srel;
722 @@ -1129,7 +1127,7 @@
723 instantiate (allocate space for them). */
724 elf_link_hash_traverse (elf_hash_table (info),
725 elf_vax_instantiate_got_entries,
726 - (PTR) info);
727 + info);
729 /* The check_relocs and adjust_dynamic_symbol entry points have
730 determined the sizes of the various dynamic sections. Allocate
731 @@ -1211,7 +1209,12 @@
732 continue;
734 /* Allocate memory for the section contents. */
735 - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size);
736 + /* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
737 + Unused entries should be reclaimed before the section's contents
738 + are written out, but at the moment this does not happen. Thus in
739 + order to prevent writing out garbage, we initialise the section's
740 + contents to zero. */
741 + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
742 if (s->contents == NULL)
743 return FALSE;
745 @@ -1268,7 +1271,7 @@
747 static bfd_boolean
748 elf_vax_discard_copies (struct elf_vax_link_hash_entry *h,
749 - PTR ignore ATTRIBUTE_UNUSED)
750 + void * ignore ATTRIBUTE_UNUSED)
752 struct elf_vax_pcrel_relocs_copied *s;
754 @@ -1659,9 +1662,9 @@
756 relocate = TRUE;
757 outrel.r_info = ELF32_R_INFO (0, R_VAX_RELATIVE);
758 - BFD_ASSERT (bfd_get_signed_32 (input_bfd,
759 - &contents[rel->r_offset]) == 0);
760 - outrel.r_addend = relocation + rel->r_addend;
761 + outrel.r_addend = bfd_get_signed_32(input_bfd,
762 + &contents[rel->r_offset])
763 + + relocation + rel->r_addend;
765 else
767 @@ -1700,14 +1703,15 @@
771 - if (!strcmp (bfd_get_section_name (input_bfd, input_section),
772 - ".text") != 0 ||
773 - (info->shared
774 - && ELF32_R_TYPE(outrel.r_info) != R_VAX_32
775 - && ELF32_R_TYPE(outrel.r_info) != R_VAX_RELATIVE
776 - && ELF32_R_TYPE(outrel.r_info) != R_VAX_COPY
777 - && ELF32_R_TYPE(outrel.r_info) != R_VAX_JMP_SLOT
778 - && ELF32_R_TYPE(outrel.r_info) != R_VAX_GLOB_DAT))
779 + if (input_section->flags & SEC_READONLY)
780 + info->flags |= DF_TEXTREL;
782 + if ((input_section->flags & SEC_READONLY) != 0
783 + || (ELF32_R_TYPE (outrel.r_info) != R_VAX_32
784 + && ELF32_R_TYPE (outrel.r_info) != R_VAX_RELATIVE
785 + && ELF32_R_TYPE (outrel.r_info) != R_VAX_COPY
786 + && ELF32_R_TYPE (outrel.r_info) != R_VAX_JMP_SLOT
787 + && ELF32_R_TYPE (outrel.r_info) != R_VAX_GLOB_DAT))
789 if (h != NULL)
790 (*_bfd_error_handler)
791 @@ -2082,12 +2086,15 @@
792 #define TARGET_LITTLE_SYM bfd_elf32_vax_vec
793 #define TARGET_LITTLE_NAME "elf32-vax"
794 #define ELF_MACHINE_CODE EM_VAX
795 -#define ELF_MAXPAGESIZE 0x1000
796 +#define ELF_MAXPAGESIZE 0x10000
798 #define elf_backend_create_dynamic_sections \
799 _bfd_elf_create_dynamic_sections
800 #define bfd_elf32_bfd_link_hash_table_create \
801 elf_vax_link_hash_table_create
802 +#define bfd_elf32_bfd_copy_private_bfd_data \
803 + elf32_vax_copy_private_bfd_data
805 #define bfd_elf32_bfd_final_link bfd_elf_gc_common_final_link
807 #define elf_backend_check_relocs elf_vax_check_relocs
808 diff -rNU3 dist/bfd/elf64-alpha.c dist.nbsd/bfd/elf64-alpha.c
809 --- dist/bfd/elf64-alpha.c Wed Nov 7 11:43:32 2012
810 +++ dist.nbsd/bfd/elf64-alpha.c Wed Nov 7 11:13:53 2012
811 @@ -99,6 +99,11 @@
812 #define PLT_ENTRY_SIZE \
813 (elf64_alpha_use_secureplt ? NEW_PLT_ENTRY_SIZE : OLD_PLT_ENTRY_SIZE)
815 +/* ld --traditional-format uses this older format instead. */
816 +#define OLD_PLT_ENTRY_WORD1 0x279f0000 /* ldah $28, 0($31) */
817 +#define OLD_PLT_ENTRY_WORD2 0x239c0000 /* lda $28, 0($28) */
818 +#define OLD_PLT_ENTRY_WORD3 0xc3e00000 /* br $31, plt0 */
820 #define MAX_GOT_SIZE (64*1024)
822 #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so"
823 @@ -4726,6 +4731,32 @@
825 plt_index = ((gotent->plt_offset - NEW_PLT_HEADER_SIZE)
826 / NEW_PLT_ENTRY_SIZE);
828 + else if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
830 + long hi, lo;
832 + /* decompose the reloc offset for the plt for ldah+lda */
833 + hi = plt_index * sizeof(Elf64_External_Rela);
834 + lo = ((hi & 0xffff) ^ 0x8000) - 0x8000;
835 + hi = (hi - lo) >> 16;
837 + insn = INSN_ABO (INSN_LDAH, 28, 31, hi);
838 + bfd_put_32 (output_bfd, insn,
839 + splt->contents + gotent->plt_offset);
841 + insn = INSN_ABO (INSN_LDA, 28, 28, lo);
842 + bfd_put_32 (output_bfd, insn,
843 + splt->contents + gotent->plt_offset + 4);
845 + disp = -(gotent->plt_offset + 12);
846 + insn = INSN_AD (INSN_BR, 31, disp);
848 + bfd_put_32 (output_bfd, insn,
849 + splt->contents + gotent->plt_offset + 8);
851 + plt_index = ((gotent->plt_offset - OLD_PLT_HEADER_SIZE)
852 + / OLD_PLT_ENTRY_SIZE);
854 else
856 diff -rNU3 dist/bfd/elf64-mips.c dist.nbsd/bfd/elf64-mips.c
857 --- dist/bfd/elf64-mips.c Wed Nov 7 11:43:32 2012
858 +++ dist.nbsd/bfd/elf64-mips.c Wed Nov 7 11:13:54 2012
859 @@ -123,6 +123,8 @@
860 (bfd *, asymbol *, bfd_boolean, char **, bfd_vma *);
861 static bfd_boolean mips_elf64_object_p
862 (bfd *);
863 +static bfd_boolean mips_elf64_is_local_label_name
864 + (bfd *, const char *);
865 static irix_compat_t elf64_mips_irix_compat
866 (bfd *);
867 static bfd_boolean elf64_mips_grok_prstatus
868 @@ -3052,7 +3054,18 @@
869 bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach);
870 return TRUE;
873 +/* MIPS ELF local labels start with "$L". */
874 +static bfd_boolean
875 +mips_elf64_is_local_label_name (bfd *abfd, const char *name)
877 + if (name[0] == '$' && name[1] == 'L')
878 + return TRUE;
880 + /* We accept the generic ELF local label syntax as well. */
881 + return _bfd_elf_is_local_label_name (abfd, name);
884 /* Depending on the target vector we generate some version of Irix
885 executables or "normal" MIPS ELF ABI executables. */
886 static irix_compat_t
887 @@ -3276,9 +3289,8 @@
889 #define elf_backend_write_section _bfd_mips_elf_write_section
891 -/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit
892 - MIPS-specific function only applies to IRIX5, which had no 64-bit
893 - ABI. */
894 +#define bfd_elf64_bfd_is_local_label_name \
895 + mips_elf64_is_local_label_name
896 #define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line
897 #define bfd_elf64_find_inliner_info _bfd_mips_elf_find_inliner_info
898 #define bfd_elf64_new_section_hook _bfd_mips_elf_new_section_hook
899 diff -rNU3 dist/bfd/elf64-ppc.c dist.nbsd/bfd/elf64-ppc.c
900 --- dist/bfd/elf64-ppc.c Wed Nov 7 11:43:32 2012
901 +++ dist.nbsd/bfd/elf64-ppc.c Wed Nov 7 11:13:53 2012
902 @@ -8877,6 +8877,10 @@
904 struct bfd_link_info *info = inf;
906 + if (info->warn_shared_textrel)
907 + (*_bfd_error_handler)
908 + (_("warning: dynamic relocation in readonly section `%s'"),
909 + h->root.root.string);
910 info->flags |= DF_TEXTREL;
912 /* Not an error, just cut short the traversal. */
913 diff -rNU3 dist/bfd/elf64-x86-64.c dist.nbsd/bfd/elf64-x86-64.c
914 --- dist/bfd/elf64-x86-64.c Wed Nov 7 11:43:32 2012
915 +++ dist.nbsd/bfd/elf64-x86-64.c Wed Nov 7 11:13:53 2012
916 @@ -2196,6 +2196,10 @@
918 struct bfd_link_info *info = (struct bfd_link_info *) inf;
920 + if (info->warn_shared_textrel)
921 + (*_bfd_error_handler)
922 + (_("warning: dynamic relocation in readonly section `%s'"),
923 + h->root.root.string);
924 info->flags |= DF_TEXTREL;
926 /* Not an error, just cut short the traversal. */
927 diff -rNU3 dist/bfd/elflink.c dist.nbsd/bfd/elflink.c
928 --- dist/bfd/elflink.c Wed Nov 7 11:43:32 2012
929 +++ dist.nbsd/bfd/elflink.c Wed Nov 7 11:13:53 2012
930 @@ -10047,7 +10047,14 @@
931 if (bed->s->arch_size == 32)
932 irel[0].r_info = ELF32_R_INFO (indx, howto->type);
933 else
934 - irel[0].r_info = ELF64_R_INFO (indx, howto->type);
935 +#ifdef BFD64
937 + bfd_uint64_t indx64 = indx;
938 + irel[0].r_info = ELF64_R_INFO (indx64, howto->type);
940 +#else
941 + BFD_FAIL();
942 +#endif
944 rel_hdr = reldata->hdr;
945 erel = rel_hdr->contents;
946 diff -rNU3 dist/bfd/elfn32-mips.c dist.nbsd/bfd/elfn32-mips.c
947 --- dist/bfd/elfn32-mips.c Wed Nov 7 11:43:32 2012
948 +++ dist.nbsd/bfd/elfn32-mips.c Wed Nov 7 11:13:53 2012
949 @@ -81,6 +81,8 @@
950 (bfd *, Elf_Internal_Note *);
951 static bfd_boolean elf32_mips_grok_psinfo
952 (bfd *, Elf_Internal_Note *);
953 +static bfd_boolean mips_elf_n32_is_local_label_name
954 + (bfd *, const char *);
955 static irix_compat_t elf_n32_mips_irix_compat
956 (bfd *);
958 @@ -2376,6 +2378,17 @@
959 return TRUE;
962 +/* MIPS ELF local labels start with "$L". */
963 +static bfd_boolean
964 +mips_elf_n32_is_local_label_name (bfd *abfd, const char *name)
966 + if (name[0] == '$' && name[1] == 'L')
967 + return TRUE;
969 + /* We accept the generic ELF local label syntax as well. */
970 + return _bfd_elf_is_local_label_name (abfd, name);
973 /* Depending on the target vector we generate some version of Irix
974 executables or "normal" MIPS ELF ABI executables. */
975 static irix_compat_t
976 @@ -2499,6 +2512,8 @@
977 #define elf_backend_write_section _bfd_mips_elf_write_section
978 #define elf_backend_mips_irix_compat elf_n32_mips_irix_compat
979 #define elf_backend_mips_rtype_to_howto mips_elf_n32_rtype_to_howto
980 +#define bfd_elf32_bfd_is_local_label_name \
981 + mips_elf_n32_is_local_label_name
982 #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
983 #define bfd_elf32_find_inliner_info _bfd_mips_elf_find_inliner_info
984 #define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook
985 diff -rNU3 dist/bfd/elfxx-mips.c dist.nbsd/bfd/elfxx-mips.c
986 --- dist/bfd/elfxx-mips.c Wed Nov 7 11:43:32 2012
987 +++ dist.nbsd/bfd/elfxx-mips.c Wed Nov 7 11:13:53 2012
988 @@ -5138,7 +5138,10 @@
989 || ((r_type == R_MIPS_26 || r_type == R_MIPS_JALR)
990 && target_is_16_bit_code_p));
992 - local_p = h == NULL || SYMBOL_REFERENCES_LOCAL (info, &h->root);
993 + local_p = h == NULL
994 + || (h->got_only_for_calls
995 + ? SYMBOL_CALLS_LOCAL (info, &h->root)
996 + : SYMBOL_REFERENCES_LOCAL (info, &h->root));
998 gp0 = _bfd_get_gp_value (input_bfd);
999 gp = _bfd_get_gp_value (abfd);
1000 @@ -7813,10 +7816,24 @@
1001 reloc types into the output file as R_MIPS_REL32
1002 relocs. Make room for this reloc in .rel(a).dyn. */
1003 mips_elf_allocate_dynamic_relocations (dynobj, info, 1);
1004 - if (MIPS_ELF_READONLY_SECTION (sec))
1005 - /* We tell the dynamic linker that there are
1006 - relocations against the text segment. */
1007 - info->flags |= DF_TEXTREL;
1008 + /* In the N32 and 64-bit ABIs there may be multiple
1009 + consecutive relocations for the same offset. If we have
1010 + a R_MIPS_GPREL32 followed by a R_MIPS_64 then that
1011 + relocation is complete and needs no futher adjustment. */
1012 + if ((rel == relocs
1013 + || rel[-1].r_offset != rel->r_offset
1014 + || r_type != R_MIPS_64
1015 + || ELF_R_TYPE(abfd, rel[-1].r_info) != R_MIPS_GPREL32)
1016 + && MIPS_ELF_READONLY_SECTION (sec))
1018 + /* We tell the dynamic linker that there are
1019 + relocations against the text segment. */
1020 + info->flags |= DF_TEXTREL;
1021 + info->callbacks->warning
1022 + (info,
1023 + _("relocation emitted against readonly section"),
1024 + NULL, abfd, sec, rel->r_offset);
1027 else
1029 diff -rNU3 dist/bfd/elfxx-sparc.c dist.nbsd/bfd/elfxx-sparc.c
1030 --- dist/bfd/elfxx-sparc.c Wed Nov 7 11:43:32 2012
1031 +++ dist.nbsd/bfd/elfxx-sparc.c Wed Nov 7 11:13:53 2012
1032 @@ -2438,6 +2438,10 @@
1034 struct bfd_link_info *info = (struct bfd_link_info *) inf;
1036 + if (info->warn_shared_textrel)
1037 + (*_bfd_error_handler)
1038 + (_("warning: dynamic relocation in readonly section `%s'"),
1039 + h->root.root.string);
1040 info->flags |= DF_TEXTREL;
1042 /* Not an error, just cut short the traversal. */
1043 @@ -3388,10 +3392,8 @@
1044 memset (&outrel, 0, sizeof outrel);
1045 /* h->dynindx may be -1 if the symbol was marked to
1046 become local. */
1047 - else if (h != NULL &&
1048 - h->dynindx != -1
1049 - && (! is_plt
1050 - || !info->shared
1051 + else if (h != NULL && h->dynindx != -1 && ! is_plt
1052 + && (!info->shared
1053 || !SYMBOLIC_BIND (info, h)
1054 || !h->def_regular))
1056 diff -rNU3 dist/bfd/libbfd.h dist.nbsd/bfd/libbfd.h
1057 --- dist/bfd/libbfd.h Wed Nov 7 11:43:32 2012
1058 +++ dist.nbsd/bfd/libbfd.h Wed Nov 7 11:13:54 2012
1059 @@ -2150,6 +2150,7 @@
1060 "BFD_RELOC_XC16X_SEG",
1061 "BFD_RELOC_XC16X_SOF",
1062 "BFD_RELOC_VAX_GLOB_DAT",
1063 + "BFD_RELOC_VAX_GLOB_REF",
1064 "BFD_RELOC_VAX_JMP_SLOT",
1065 "BFD_RELOC_VAX_RELATIVE",
1066 "BFD_RELOC_MT_PC16",
1067 diff -rNU3 dist/bfd/reloc.c dist.nbsd/bfd/reloc.c
1068 --- dist/bfd/reloc.c Wed Nov 7 11:43:32 2012
1069 +++ dist.nbsd/bfd/reloc.c Wed Nov 7 11:13:53 2012
1070 @@ -1775,6 +1775,17 @@
1071 Relocations used by 68K ELF.
1073 ENUM
1074 + BFD_RELOC_VAX_GLOB_DAT
1075 +ENUMX
1076 + BFD_RELOC_VAX_GLOB_REF
1077 +ENUMX
1078 + BFD_RELOC_VAX_JMP_SLOT
1079 +ENUMX
1080 + BFD_RELOC_VAX_RELATIVE
1081 +ENUMDOC
1082 + Relocations used by VAX ELF.
1084 +ENUM
1085 BFD_RELOC_32_BASEREL
1086 ENUMX
1087 BFD_RELOC_16_BASEREL
1088 diff -rNU3 dist/binutils/Makefile.in dist.nbsd/binutils/Makefile.in
1089 --- dist/binutils/Makefile.in Wed Nov 7 11:43:32 2012
1090 +++ dist.nbsd/binutils/Makefile.in Wed Nov 7 11:13:54 2012
1091 @@ -1,4 +1,4 @@
1092 -# Makefile.in generated by automake 1.11.1 from Makefile.am.
1093 +# Makefile.in generated by automake 1.11 from Makefile.am.
1094 # @configure_input@
1096 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
1097 @@ -49,10 +49,12 @@
1098 DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \
1099 $(srcdir)/Makefile.am $(top_srcdir)/configure \
1100 $(am__configure_deps) $(srcdir)/config.in \
1101 - $(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in arparse.h \
1102 - arparse.c arlex.c defparse.h defparse.c deflex.c nlmheader.h \
1103 - nlmheader.c arparse.h arparse.c arlex.c mcparse.h mcparse.c \
1104 - rcparse.h rcparse.c $(srcdir)/../depcomp $(srcdir)/../ylwrap
1105 + $(srcdir)/../mkinstalldirs $(srcdir)/../mkinstalldirs \
1106 + $(top_srcdir)/po/Make-in arparse.h arparse.c arlex.c \
1107 + defparse.h defparse.c deflex.c nlmheader.h nlmheader.c \
1108 + arparse.h arparse.c arlex.c mcparse.h mcparse.c rcparse.h \
1109 + rcparse.c $(srcdir)/../depcomp $(srcdir)/../depcomp \
1110 + $(srcdir)/../ylwrap $(srcdir)/../ylwrap
1111 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1112 am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
1113 $(top_srcdir)/../config/zlib.m4 \
1114 @@ -380,6 +382,7 @@
1115 libexecdir = @libexecdir@
1116 localedir = @localedir@
1117 localstatedir = @localstatedir@
1118 +lt_ECHO = @lt_ECHO@
1119 mandir = @mandir@
1120 mkdir_p = @mkdir_p@
1121 oldincludedir = @oldincludedir@
1122 @@ -921,7 +924,7 @@
1123 # (which will cause the Makefiles to be regenerated when you run `make');
1124 # (2) otherwise, pass the desired values on the `make' command line.
1125 $(RECURSIVE_TARGETS):
1126 - @fail= failcom='exit 1'; \
1127 + @failcom='exit 1'; \
1128 for f in x $$MAKEFLAGS; do \
1129 case $$f in \
1130 *=* | --[!k]*);; \
1131 @@ -946,7 +949,7 @@
1132 fi; test -z "$$fail"
1134 $(RECURSIVE_CLEAN_TARGETS):
1135 - @fail= failcom='exit 1'; \
1136 + @failcom='exit 1'; \
1137 for f in x $$MAKEFLAGS; do \
1138 case $$f in \
1139 *=* | --[!k]*);; \
1140 diff -rNU3 dist/binutils/aclocal.m4 dist.nbsd/binutils/aclocal.m4
1141 --- dist/binutils/aclocal.m4 Wed Nov 7 11:43:32 2012
1142 +++ dist.nbsd/binutils/aclocal.m4 Wed Nov 7 11:13:54 2012
1143 @@ -1,4 +1,4 @@
1144 -# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
1145 +# generated automatically by aclocal 1.11 -*- Autoconf -*-
1147 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1148 # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
1149 @@ -19,6 +19,31 @@
1150 If you have problems, you may need to regenerate the build system entirely.
1151 To do so, use the procedure documented by the package, typically `autoreconf'.])])
1153 +# isc-posix.m4 serial 2 (gettext-0.11.2)
1154 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1155 +dnl This file is free software; the Free Software Foundation
1156 +dnl gives unlimited permission to copy and/or distribute it,
1157 +dnl with or without modifications, as long as this notice is preserved.
1159 +# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1161 +# This test replaces the one in autoconf.
1162 +# Currently this macro should have the same name as the autoconf macro
1163 +# because gettext's gettext.m4 (distributed in the automake package)
1164 +# still uses it. Otherwise, the use in gettext.m4 makes autoheader
1165 +# give these diagnostics:
1166 +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1167 +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1169 +undefine([AC_ISC_POSIX])
1171 +AC_DEFUN([AC_ISC_POSIX],
1173 + dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1174 + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1178 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1180 # This file is free software; the Free Software Foundation
1181 @@ -34,7 +59,7 @@
1182 [am__api_version='1.11'
1183 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1184 dnl require some minimum version. Point them to the right macro.
1185 -m4_if([$1], [1.11.1], [],
1186 +m4_if([$1], [1.11], [],
1187 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1190 @@ -50,7 +75,7 @@
1191 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1192 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1193 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1194 -[AM_AUTOMAKE_VERSION([1.11.1])dnl
1195 +[AM_AUTOMAKE_VERSION([1.11])dnl
1196 m4_ifndef([AC_AUTOCONF_VERSION],
1197 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1198 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1199 diff -rNU3 dist/binutils/bucomm.c dist.nbsd/binutils/bucomm.c
1200 --- dist/binutils/bucomm.c Wed Nov 7 11:43:32 2012
1201 +++ dist.nbsd/binutils/bucomm.c Wed Nov 7 11:13:54 2012
1202 @@ -576,7 +576,14 @@
1203 file_name, strerror (errno));
1205 else if (! S_ISREG (statbuf.st_mode))
1206 - non_fatal (_("Warning: '%s' is not an ordinary file"), file_name);
1208 + if (!S_ISCHR(statbuf.st_mode))
1210 + non_fatal (_("Warning: '%s' is not an ordinary file"), file_name);
1211 + return 0;
1213 + return statbuf.st_size ? statbuf.st_size : 1;
1215 else if (statbuf.st_size < 0)
1216 non_fatal (_("Warning: '%s' has negative size, probably it is too large"),
1217 file_name);
1218 diff -rNU3 dist/binutils/doc/Makefile.am dist.nbsd/binutils/doc/Makefile.am
1219 --- dist/binutils/doc/Makefile.am Wed Nov 7 11:43:32 2012
1220 +++ dist.nbsd/binutils/doc/Makefile.am Wed Nov 7 11:13:54 2012
1221 @@ -42,6 +42,8 @@
1223 # Man page generation from texinfo
1224 addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1225 + @echo "NOT REBUILDING $@"
1226 +NetBSD_DISABLED_addr2line.1:
1227 touch $@
1228 -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod
1229 -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1230 @@ -49,6 +51,8 @@
1231 rm -f addr2line.pod
1233 ar.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1234 + @echo "NOT REBUILDING $@"
1235 +NetBSD_DISABLED_ar.1:
1236 touch $@
1237 -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod
1238 -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1239 @@ -56,6 +60,8 @@
1240 rm -f ar.pod
1242 dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1243 + @echo "NOT REBUILDING $@"
1244 +NetBSD_DISABLED_dlltool.1:
1245 touch $@
1246 -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod
1247 -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1248 @@ -63,6 +69,8 @@
1249 rm -f dlltool.pod
1251 nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1252 + @echo "NOT REBUILDING $@"
1253 +NetBSD_DISABLED_nlmconv.1:
1254 touch $@
1255 -$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod
1256 -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1257 @@ -70,6 +78,8 @@
1258 rm -f nlmconv.pod
1260 nm.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1261 + @echo "NOT REBUILDING $@"
1262 +NetBSD_DISABLED_nm.1:
1263 touch $@
1264 -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod
1265 -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1266 @@ -77,6 +87,8 @@
1267 rm -f nm.pod
1269 objcopy.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1270 + @echo "NOT REBUILDING $@"
1271 +NetBSD_DISABLED_objcopy.1:
1272 touch $@
1273 -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod
1274 -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1275 @@ -84,6 +96,8 @@
1276 rm -f objcopy.pod
1278 objdump.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1279 + @echo "NOT REBUILDING $@"
1280 +NetBSD_DISABLED_objdump.1:
1281 touch $@
1282 -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod
1283 -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1284 @@ -91,6 +105,8 @@
1285 rm -f objdump.pod
1287 ranlib.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1288 + @echo "NOT REBUILDING $@"
1289 +NetBSD_DISABLED_ranlib.1:
1290 touch $@
1291 -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod
1292 -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1293 @@ -98,6 +114,8 @@
1294 rm -f ranlib.pod
1296 readelf.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1297 + @echo "NOT REBUILDING $@"
1298 +NetBSD_DISABLED_readelf.1:
1299 touch $@
1300 -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod
1301 -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1302 @@ -105,6 +123,8 @@
1303 rm -f readelf.pod
1305 size.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1306 + @echo "NOT REBUILDING $@"
1307 +NetBSD_DISABLED_size.1:
1308 touch $@
1309 -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod
1310 -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1311 @@ -112,6 +132,8 @@
1312 rm -f size.pod
1314 strings.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1315 + @echo "NOT REBUILDING $@"
1316 +NetBSD_DISABLED_strings.1:
1317 touch $@
1318 -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod
1319 -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1320 @@ -119,6 +141,8 @@
1321 rm -f strings.pod
1323 strip.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1324 + @echo "NOT REBUILDING $@"
1325 +NetBSD_DISABLED_strip.1:
1326 touch $@
1327 -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod
1328 -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1329 @@ -133,6 +157,8 @@
1330 rm -f elfedit.pod
1332 windres.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1333 + @echo "NOT REBUILDING $@"
1334 +NetBSD_DISABLED_windres.1:
1335 touch $@
1336 -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod
1337 -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1338 @@ -140,6 +166,8 @@
1339 rm -f windres.pod
1341 windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1342 + @echo "NOT REBUILDING $@"
1343 +NetBSD_DISABLED_windmc.1:
1344 touch $@
1345 -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod
1346 -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1347 @@ -147,6 +175,8 @@
1348 rm -f windmc.pod
1350 cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS)
1351 + @echo "NOT REBUILDING $@"
1352 +NetBSD_DISABLED_cxxfilt.man:
1353 touch $@
1354 -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod
1355 -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1356 diff -rNU3 dist/binutils/doc/Makefile.in dist.nbsd/binutils/doc/Makefile.in
1357 --- dist/binutils/doc/Makefile.in Wed Nov 7 11:43:32 2012
1358 +++ dist.nbsd/binutils/doc/Makefile.in Wed Nov 7 11:13:54 2012
1359 @@ -1,4 +1,4 @@
1360 -# Makefile.in generated by automake 1.11.1 from Makefile.am.
1361 +# Makefile.in generated by automake 1.11 from Makefile.am.
1362 # @configure_input@
1364 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
1365 @@ -240,6 +240,7 @@
1366 libexecdir = @libexecdir@
1367 localedir = @localedir@
1368 localstatedir = @localstatedir@
1369 +lt_ECHO = @lt_ECHO@
1370 mandir = @mandir@
1371 mkdir_p = @mkdir_p@
1372 oldincludedir = @oldincludedir@
1373 @@ -347,6 +348,8 @@
1374 -rm -rf .libs _libs
1376 binutils.info: binutils.texi
1377 + @echo "NOT REBUILDING $@"
1378 +NetBSD_DISABLED_binutils.info: binutils.texi
1379 restore=: && backupdir="$(am__leading_dot)am$$$$" && \
1380 rm -rf $$backupdir && mkdir $$backupdir && \
1381 if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
1382 @@ -733,6 +736,8 @@
1384 # Man page generation from texinfo
1385 addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1386 + @echo "NOT REBUILDING $@"
1387 +NetBSD_DISABLED_addr2line.1:
1388 touch $@
1389 -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod
1390 -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1391 @@ -740,6 +745,8 @@
1392 rm -f addr2line.pod
1394 ar.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1395 + @echo "NOT REBUILDING $@"
1396 +NetBSD_DISABLED_ar.1:
1397 touch $@
1398 -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod
1399 -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1400 @@ -747,6 +754,8 @@
1401 rm -f ar.pod
1403 dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1404 + @echo "NOT REBUILDING $@"
1405 +NetBSD_DISABLED_dlltool.1:
1406 touch $@
1407 -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod
1408 -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1409 @@ -754,6 +763,8 @@
1410 rm -f dlltool.pod
1412 nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1413 + @echo "NOT REBUILDING $@"
1414 +NetBSD_DISABLED_nlmconv.1:
1415 touch $@
1416 -$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod
1417 -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1418 @@ -761,6 +772,8 @@
1419 rm -f nlmconv.pod
1421 nm.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1422 + @echo "NOT REBUILDING $@"
1423 +NetBSD_DISABLED_nm.1:
1424 touch $@
1425 -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod
1426 -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1427 @@ -768,6 +781,8 @@
1428 rm -f nm.pod
1430 objcopy.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1431 + @echo "NOT REBUILDING $@"
1432 +NetBSD_DISABLED_objcopy.1:
1433 touch $@
1434 -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod
1435 -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1436 @@ -775,6 +790,8 @@
1437 rm -f objcopy.pod
1439 objdump.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1440 + @echo "NOT REBUILDING $@"
1441 +NetBSD_DISABLED_objdump.1:
1442 touch $@
1443 -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod
1444 -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1445 @@ -782,6 +799,8 @@
1446 rm -f objdump.pod
1448 ranlib.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1449 + @echo "NOT REBUILDING $@"
1450 +NetBSD_DISABLED_ranlib.1:
1451 touch $@
1452 -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod
1453 -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1454 @@ -789,6 +808,8 @@
1455 rm -f ranlib.pod
1457 readelf.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1458 + @echo "NOT REBUILDING $@"
1459 +NetBSD_DISABLED_readelf.1:
1460 touch $@
1461 -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod
1462 -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1463 @@ -796,6 +817,8 @@
1464 rm -f readelf.pod
1466 size.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1467 + @echo "NOT REBUILDING $@"
1468 +NetBSD_DISABLED_size.1:
1469 touch $@
1470 -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod
1471 -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1472 @@ -803,6 +826,8 @@
1473 rm -f size.pod
1475 strings.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1476 + @echo "NOT REBUILDING $@"
1477 +NetBSD_DISABLED_strings.1:
1478 touch $@
1479 -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod
1480 -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1481 @@ -810,6 +835,8 @@
1482 rm -f strings.pod
1484 strip.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1485 + @echo "NOT REBUILDING $@"
1486 +NetBSD_DISABLED_strip.1:
1487 touch $@
1488 -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod
1489 -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1490 @@ -817,6 +844,8 @@
1491 rm -f strip.pod
1493 elfedit.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1494 + @echo "NOT REBUILDING $@"
1495 +NetBSD_DISABLED_elfedit.1:
1496 touch $@
1497 -$(TEXI2POD) $(MANCONF) -Delfedit < $(binutils_TEXI) > elfedit.pod
1498 -($(POD2MAN) elfedit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1499 @@ -824,6 +853,8 @@
1500 rm -f elfedit.pod
1502 windres.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1503 + @echo "NOT REBUILDING $@"
1504 +NetBSD_DISABLED_windres.1:
1505 touch $@
1506 -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod
1507 -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1508 @@ -831,6 +862,8 @@
1509 rm -f windres.pod
1511 windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS)
1512 + @echo "NOT REBUILDING $@"
1513 +NetBSD_DISABLED_windmc.1:
1514 touch $@
1515 -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod
1516 -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1517 @@ -838,6 +871,8 @@
1518 rm -f windmc.pod
1520 cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS)
1521 + @echo "NOT REBUILDING $@"
1522 +NetBSD_DISABLED_cxxfilt.man:
1523 touch $@
1524 -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod
1525 -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
1526 diff -rNU3 dist/binutils/doc/elfedit.1 dist.nbsd/binutils/doc/elfedit.1
1527 --- dist/binutils/doc/elfedit.1 Wed Nov 7 11:43:32 2012
1528 +++ dist.nbsd/binutils/doc/elfedit.1 Wed Nov 7 11:13:54 2012
1529 @@ -1,15 +1,7 @@
1530 -.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
1531 +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
1533 .\" Standard preamble:
1534 .\" ========================================================================
1535 -.de Sh \" Subsection heading
1536 -.br
1537 -.if t .Sp
1538 -.ne 5
1539 -.PP
1540 -\fB\\$1\fR
1541 -.PP
1543 .de Sp \" Vertical space (when we can't use .PP)
1544 .if t .sp .5v
1545 .if n .sp
1546 @@ -53,7 +45,7 @@
1547 .el .ds Aq '
1549 .\" If the F register is turned on, we'll generate index entries on stderr for
1550 -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
1551 +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
1552 .\" entries marked with X<> in POD. Of course, you'll have to process the
1553 .\" output yourself in some meaningful fashion.
1554 .ie \nF \{\
1555 @@ -132,7 +124,7 @@
1556 .\" ========================================================================
1558 .IX Title "ELFEDIT 1"
1559 -.TH ELFEDIT 1 "2011-06-27" "binutils-2.21.1" "GNU Development Tools"
1560 +.TH ELFEDIT 1 "2011-09-24" "binutils-2.21.1" "GNU Development Tools"
1561 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
1562 .\" way too many mistakes in technical documents.
1563 .if n .ad l
1564 diff -rNU3 dist/binutils/doc/strings.1 dist.nbsd/binutils/doc/strings.1
1565 --- dist/binutils/doc/strings.1 Wed Nov 7 11:43:32 2012
1566 +++ dist.nbsd/binutils/doc/strings.1 Wed Nov 7 11:13:54 2012
1567 @@ -216,7 +216,7 @@
1568 characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBS\fR =
1569 single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR =
1570 16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit
1571 -littleendian. Useful for finding wide character strings. (\fBl\fR
1572 +littleendian. Useful for finding wide-character strings. (\fBl\fR
1573 and \fBb\fR apply to, for example, Unicode \s-1UTF\-16/UCS\-2\s0 encodings).
1574 .IP "\fB\-T\fR \fIbfdname\fR" 4
1575 .IX Item "-T bfdname"
1576 diff -rNU3 dist/binutils/objcopy.c dist.nbsd/binutils/objcopy.c
1577 --- dist/binutils/objcopy.c Wed Nov 7 11:43:32 2012
1578 +++ dist.nbsd/binutils/objcopy.c Wed Nov 7 11:13:54 2012
1579 @@ -31,6 +31,7 @@
1580 #include "fnmatch.h"
1581 #include "elf-bfd.h"
1582 #include <sys/stat.h>
1583 +#include <ctype.h>
1584 #include "libbfd.h"
1585 #include "coff/internal.h"
1586 #include "libcoff.h"
1587 diff -rNU3 dist/binutils/readelf.c dist.nbsd/binutils/readelf.c
1588 --- dist/binutils/readelf.c Wed Nov 7 11:43:31 2012
1589 +++ dist.nbsd/binutils/readelf.c Wed Nov 7 11:13:54 2012
1590 @@ -11933,6 +11933,23 @@
1592 break;
1594 + /* On SuperH, PT_GETREGS == mach+3 and PT_GETFPREGS == mach+5.
1595 + There's also old PT___GETREGS40 == mach + 1 for old reg
1596 + structure which lacks GBR. */
1597 + case EM_SH:
1598 + switch (e_type)
1600 + case NT_NETBSDCORE_FIRSTMACH + 1:
1601 + return _("PT___GETREGS40 (old reg structure)");
1602 + case NT_NETBSDCORE_FIRSTMACH + 3:
1603 + return _("PT_GETREGS (reg structure)");
1604 + case NT_NETBSDCORE_FIRSTMACH + 5:
1605 + return _("PT_GETFPREGS (fpreg structure)");
1606 + default:
1607 + break;
1609 + break;
1611 /* On all other arch's, PT_GETREGS == mach+1 and
1612 PT_GETFPREGS == mach+3. */
1613 default:
1614 diff -rNU3 dist/binutils/strings.c dist.nbsd/binutils/strings.c
1615 --- dist/binutils/strings.c Wed Nov 7 11:43:31 2012
1616 +++ dist.nbsd/binutils/strings.c Wed Nov 7 11:13:54 2012
1617 @@ -596,7 +596,7 @@
1618 else
1619 #elif !BFD_HOST_64BIT_LONG
1620 if (start != (unsigned long) start)
1621 - printf ("++%7ld ", (unsigned long) start);
1622 + printf ("++%7llu ", (unsigned long) start);
1623 else
1624 #endif
1625 printf ("%7ld ", (long) start);
1626 diff -rNU3 dist/config.guess dist.nbsd/config.guess
1627 --- dist/config.guess Wed Nov 7 11:43:31 2012
1628 +++ dist.nbsd/config.guess Wed Nov 7 11:13:54 2012
1629 @@ -968,6 +968,9 @@
1630 sparc:Linux:*:* | sparc64:Linux:*:*)
1631 echo ${UNAME_MACHINE}-unknown-linux-gnu
1632 exit ;;
1633 + tile*:Linux:*:*)
1634 + echo ${UNAME_MACHINE}-unknown-linux-gnu
1635 + exit ;;
1636 vax:Linux:*:*)
1637 echo ${UNAME_MACHINE}-dec-linux-gnu
1638 exit ;;
1639 diff -rNU3 dist/config.sub dist.nbsd/config.sub
1640 --- dist/config.sub Wed Nov 7 11:43:31 2012
1641 +++ dist.nbsd/config.sub Wed Nov 7 11:13:54 2012
1642 @@ -4,7 +4,7 @@
1643 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
1644 # Free Software Foundation, Inc.
1646 -timestamp='2010-05-21'
1647 +timestamp='2009-12-31'
1649 # This file is (in principle) common to ALL GNU software.
1650 # The presence of a machine in this file suggests that SOME GNU software
1651 @@ -124,9 +124,9 @@
1652 # Here we must recognize all the valid KERNEL-OS combinations.
1653 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1654 case $maybe_os in
1655 - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
1656 - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
1657 - knetbsd*-gnu* | netbsd*-gnu* | \
1658 + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
1659 + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | \
1660 + netbsd*-gnu* | netbsd*-eabi* | \
1661 kopensolaris*-gnu* | \
1662 storm-chaos* | os2-emx* | rtmk-nova*)
1663 os=-$maybe_os
1664 @@ -296,7 +296,7 @@
1665 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
1666 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
1667 | spu | strongarm \
1668 - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
1669 + | tahoe | thumb | tic4x | tic80 | tron \
1670 | ubicom32 \
1671 | v850 | v850e \
1672 | we32k \
1673 @@ -304,15 +304,6 @@
1674 | z8k | z80)
1675 basic_machine=$basic_machine-unknown
1677 - c54x)
1678 - basic_machine=tic54x-unknown
1679 - ;;
1680 - c55x)
1681 - basic_machine=tic55x-unknown
1682 - ;;
1683 - c6x)
1684 - basic_machine=tic6x-unknown
1685 - ;;
1686 m6811 | m68hc11 | m6812 | m68hc12 | picochip)
1687 # Motorola 68HC11/12.
1688 basic_machine=$basic_machine-unknown
1689 @@ -344,7 +335,7 @@
1690 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
1691 | avr-* | avr32-* \
1692 | bfin-* | bs2000-* \
1693 - | c[123]* | c30-* | [cjt]90-* | c4x-* \
1694 + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
1695 | clipper-* | craynv-* | cydra-* \
1696 | d10v-* | d30v-* | dlx-* \
1697 | elxsi-* \
1698 @@ -391,8 +382,7 @@
1699 | sparclite-* \
1700 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
1701 | tahoe-* | thumb-* \
1702 - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
1703 - | tile-* | tilegx-* \
1704 + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
1705 | tron-* \
1706 | ubicom32-* \
1707 | v850-* | v850e-* | vax-* \
1708 @@ -492,15 +482,6 @@
1709 basic_machine=powerpc-ibm
1710 os=-cnk
1712 - c54x-*)
1713 - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
1714 - ;;
1715 - c55x-*)
1716 - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
1717 - ;;
1718 - c6x-*)
1719 - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
1720 - ;;
1721 c90)
1722 basic_machine=c90-cray
1723 os=-unicos
1724 @@ -1094,11 +1075,18 @@
1725 basic_machine=t90-cray
1726 os=-unicos
1728 - # This must be matched before tile*.
1729 - tilegx*)
1730 - basic_machine=tilegx-unknown
1731 - os=-linux-gnu
1732 + tic54x | c54x*)
1733 + basic_machine=tic54x-unknown
1734 + os=-coff
1736 + tic55x | c55x*)
1737 + basic_machine=tic55x-unknown
1738 + os=-coff
1739 + ;;
1740 + tic6x | c6x*)
1741 + basic_machine=tic6x-unknown
1742 + os=-coff
1743 + ;;
1744 tile*)
1745 basic_machine=tile-unknown
1746 os=-linux-gnu
1747 @@ -1308,8 +1296,7 @@
1748 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1749 | -chorusos* | -chorusrdb* | -cegcc* \
1750 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1751 - | -mingw32* | -linux-gnu* | -linux-android* \
1752 - | -linux-newlib* | -linux-uclibc* \
1753 + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1754 | -uxpv* | -beos* | -mpeix* | -udk* \
1755 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1756 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1757 @@ -1491,15 +1478,6 @@
1759 c4x-* | tic4x-*)
1760 os=-coff
1761 - ;;
1762 - tic54x-*)
1763 - os=-coff
1764 - ;;
1765 - tic55x-*)
1766 - os=-coff
1767 - ;;
1768 - tic6x-*)
1769 - os=-coff
1771 # This must come before the *-dec entry.
1772 pdp10-*)
1773 diff -rNU3 dist/configure dist.nbsd/configure
1774 --- dist/configure Wed Nov 7 11:43:31 2012
1775 +++ dist.nbsd/configure Wed Nov 7 11:13:54 2012
1776 @@ -2670,7 +2670,7 @@
1777 # binutils, gas and ld appear in that order because it makes sense to run
1778 # "make check" in that particular order.
1779 # If --enable-gold is used, "gold" may replace "ld".
1780 -host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc cgen sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
1781 +host_tools="byacc flex bison binutils gas ld fixincludes gcc cgen sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
1783 # libgcj represents the runtime libraries only used by gcj.
1784 libgcj="target-libffi \
1785 diff -rNU3 dist/gas/atof-generic.c dist.nbsd/gas/atof-generic.c
1786 --- dist/gas/atof-generic.c Wed Nov 7 11:43:31 2012
1787 +++ dist.nbsd/gas/atof-generic.c Wed Nov 7 11:13:45 2012
1788 @@ -121,6 +121,32 @@
1790 switch (first_digit[0])
1792 + case 's':
1793 + case 'S':
1794 + if (!strncasecmp ("snan", first_digit, 4))
1796 + address_of_generic_floating_point_number->sign = 0;
1797 + address_of_generic_floating_point_number->exponent = 0;
1798 + address_of_generic_floating_point_number->leader =
1799 + address_of_generic_floating_point_number->low;
1800 + *address_of_string_pointer = first_digit + 4;
1801 + return 0;
1803 + break;
1805 + case 'q':
1806 + case 'Q':
1807 + if (!strncasecmp ("qnan", first_digit, 4))
1809 + address_of_generic_floating_point_number->sign = 0;
1810 + address_of_generic_floating_point_number->exponent = 0;
1811 + address_of_generic_floating_point_number->leader =
1812 + address_of_generic_floating_point_number->low;
1813 + *address_of_string_pointer = first_digit + 4;
1814 + return 0;
1816 + break;
1818 case 'n':
1819 case 'N':
1820 if (!strncasecmp ("nan", first_digit, 3))
1821 diff -rNU3 dist/gas/config/atof-vax.c dist.nbsd/gas/config/atof-vax.c
1822 --- dist/gas/config/atof-vax.c Wed Nov 7 11:43:31 2012
1823 +++ dist.nbsd/gas/config/atof-vax.c Wed Nov 7 11:13:46 2012
1824 @@ -268,10 +268,27 @@
1825 int exponent_skippage;
1826 LITTLENUM_TYPE word1;
1828 - /* JF: Deal with new Nan, +Inf and -Inf codes. */
1829 if (f->sign != '-' && f->sign != '+')
1831 - make_invalid_floating_point_number (words);
1832 + if (f->sign == 0)
1834 + /* All NaNs are 0. */
1835 + memset (words, 0x00, sizeof (LITTLENUM_TYPE) * precision);
1837 + else if (f->sign == 'P')
1839 + /* Positive Infinity. */
1840 + memset (words, 0xff, sizeof (LITTLENUM_TYPE) * precision);
1841 + words[0] &= 0x7fff;
1843 + else if (f->sign == 'N')
1845 + /* Negative Infinity. */
1846 + memset (words, 0x00, sizeof (LITTLENUM_TYPE) * precision);
1847 + words[0] = 0x0080;
1849 + else
1850 + make_invalid_floating_point_number (words);
1851 return return_value;
1854 diff -rNU3 dist/gas/config/tc-arm.c dist.nbsd/gas/config/tc-arm.c
1855 --- dist/gas/config/tc-arm.c Wed Nov 7 11:43:31 2012
1856 +++ dist.nbsd/gas/config/tc-arm.c Wed Nov 7 11:13:46 2012
1857 @@ -16133,12 +16133,16 @@
1858 asection *sect;
1860 for (sect = stdoutput->sections; sect != NULL; sect = sect->next)
1861 - if (seg_info (sect)->tc_segment_info_data.current_it.state
1862 - == MANUAL_IT_BLOCK)
1864 - as_warn (_("section '%s' finished with an open IT block."),
1865 - sect->name);
1868 + segment_info_type *seginfo = seg_info (sect);
1870 + if (seginfo && seginfo->tc_segment_info_data.current_it.state
1871 + == MANUAL_IT_BLOCK)
1873 + as_warn (_("section '%s' finished with an open IT block."),
1874 + sect->name);
1877 #else
1878 if (now_it.state == MANUAL_IT_BLOCK)
1879 as_warn (_("file finished with an open IT block."));
1880 diff -rNU3 dist/gas/config/tc-mips.c dist.nbsd/gas/config/tc-mips.c
1881 --- dist/gas/config/tc-mips.c Wed Nov 7 11:43:31 2012
1882 +++ dist.nbsd/gas/config/tc-mips.c Wed Nov 7 11:13:46 2012
1883 @@ -763,6 +763,9 @@
1884 NUM_FIX_VR4120_CLASSES
1887 +/* ...likewise -mtrap-zero-jump. */
1888 +static bfd_boolean mips_trap_zero_jump;
1890 /* ...likewise -mfix-loongson2f-jump. */
1891 static bfd_boolean mips_fix_loongson2f_jump;
1893 @@ -795,6 +798,8 @@
1894 efficient expansion. */
1896 static int mips_relax_branch;
1898 +static int mips_fix_loongson2f_btb;
1900 /* The expansion of many macros depends on the type of symbol that
1901 they refer to. For example, when generating position-dependent code,
1902 @@ -1068,6 +1073,7 @@
1903 static void mips16_macro_build
1904 (expressionS *, const char *, const char *, va_list *);
1905 static void load_register (int, expressionS *, int);
1906 +static void macro_build (expressionS *, const char *, const char *, ...);
1907 static void macro_start (void);
1908 static void macro_end (void);
1909 static void macro (struct mips_cl_insn * ip);
1910 @@ -2744,6 +2750,35 @@
1911 return nops;
1914 +static void
1915 +trap_zero_jump (struct mips_cl_insn * ip)
1917 + if (strcmp (ip->insn_mo->name, "j") == 0
1918 + || strcmp (ip->insn_mo->name, "jr") == 0
1919 + || strcmp (ip->insn_mo->name, "jalr") == 0)
1921 + int sreg;
1923 + if (mips_opts.warn_about_macros)
1924 + return;
1926 + sreg = EXTRACT_OPERAND (RS, *ip);
1927 + if (mips_opts.isa == ISA_MIPS32
1928 + || mips_opts.isa == ISA_MIPS32R2
1929 + || mips_opts.isa == ISA_MIPS64
1930 + || mips_opts.isa == ISA_MIPS64R2)
1932 + expressionS ep;
1933 + ep.X_op = O_constant;
1934 + ep.X_add_number = 4096;
1935 + macro_build (&ep, "tltiu", "s,j", sreg, BFD_RELOC_LO16);
1937 + else if (mips_opts.isa != ISA_UNKNOWN
1938 + && mips_opts.isa != ISA_MIPS1)
1939 + macro_build (NULL, "teq", "s,t", sreg, 0);
1943 /* Fix NOP issue: Replace nops by "or at,at,zero". */
1945 static void
1946 @@ -2779,6 +2814,12 @@
1947 ep.X_add_number = 0xffff;
1948 macro_build (&ep, "ori", "t,r,i", ATREG, ATREG, BFD_RELOC_LO16);
1949 macro_build (NULL, "and", "d,v,t", sreg, sreg, ATREG);
1950 + /* Hide these three instructions to avoid getting a ``macro expanded into
1951 + multiple instructions'' warning. */
1952 + if (mips_relax.sequence != 2)
1953 + mips_macro_warning.sizes[0] -= 3 * 4;
1954 + if (mips_relax.sequence != 1)
1955 + mips_macro_warning.sizes[1] -= 3 * 4;
1959 @@ -2807,6 +2848,8 @@
1961 if (mips_fix_loongson2f)
1962 fix_loongson2f (ip);
1963 + if (mips_trap_zero_jump)
1964 + trap_zero_jump (ip);
1966 /* Mark instruction labels in mips16 mode. */
1967 mips16_mark_labels ();
1968 @@ -3602,6 +3645,41 @@
1969 r[i] = (bfd_reloc_code_real_type) va_arg (*args, int);
1972 +/* Fix jump through register issue on loongson2f processor for kernel code:
1973 + force a BTB clear before the jump to prevent it from being incorrectly
1974 + prefetched by the branch prediction engine. */
1976 +static void
1977 +macro_build_jrpatch (expressionS *ep, unsigned int sreg)
1979 + if (!mips_fix_loongson2f_btb)
1980 + return;
1982 + if (sreg == ZERO || sreg == KT0 || sreg == KT1 || sreg == AT)
1983 + return;
1985 + if (!mips_opts.at)
1987 + as_warn (_("unable to apply loongson2f BTB workaround when .set noat"));
1988 + return;
1991 + /* li $at, COP_0_BTB_CLEAR | COP_0_RAS_DISABLE */
1992 + ep->X_op = O_constant;
1993 + ep->X_add_number = 3;
1994 + macro_build (ep, "ori", "t,r,i", AT, ZERO, BFD_RELOC_LO16);
1996 + /* dmtc0 $at, COP_0_DIAG */
1997 + macro_build (NULL, "dmtc0", "t,G", AT, 22);
1999 + /* Hide these two instructions to avoid getting a ``macro expanded into
2000 + multiple instructions'' warning. */
2001 + if (mips_relax.sequence != 2)
2002 + mips_macro_warning.sizes[0] -= 2 * 4;
2003 + if (mips_relax.sequence != 1)
2004 + mips_macro_warning.sizes[1] -= 2 * 4;
2007 /* Build an instruction created by a macro expansion. This is passed
2008 a pointer to the count of instructions created so far, an
2009 expression, the name of the instruction to build, an operand format
2010 @@ -3999,6 +4077,7 @@
2011 frag_grow (8);
2012 f = frag_more (0);
2014 + macro_build_jrpatch (ep, PIC_CALL_REG);
2015 macro_build (NULL, "jalr", "d,s", RA, PIC_CALL_REG);
2016 if (MIPS_JALR_HINT_P (ep))
2017 fix_new_exp (frag_now, f - frag_now->fr_literal,
2018 @@ -6138,6 +6217,26 @@
2019 macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", treg, tempreg, breg);
2020 break;
2022 + case M_JR_S:
2023 + macro_build_jrpatch (&expr1, sreg);
2024 + macro_build (NULL, "jr", "s", sreg);
2025 + return; /* didn't modify $at */
2027 + case M_J_S:
2028 + macro_build_jrpatch (&expr1, sreg);
2029 + macro_build (NULL, "j", "s", sreg);
2030 + return; /* didn't modify $at */
2032 + case M_JALR_S:
2033 + macro_build_jrpatch (&expr1, sreg);
2034 + macro_build (NULL, "jalr", "s", sreg);
2035 + return; /* didn't modify $at */
2037 + case M_JALR_DS:
2038 + macro_build_jrpatch (&expr1, sreg);
2039 + macro_build (NULL, "jalr", "d,s", dreg, sreg);
2040 + return; /* didn't modify $at */
2042 case M_MSGSND:
2044 unsigned long temp = (treg << 16) | (0x01);
2045 @@ -6193,12 +6292,16 @@
2046 /* Fall through. */
2047 case M_JAL_2:
2048 if (mips_pic == NO_PIC)
2049 - macro_build (NULL, "jalr", "d,s", dreg, sreg);
2051 + macro_build_jrpatch (&expr1, sreg);
2052 + macro_build (NULL, "jalr", "d,s", dreg, sreg);
2054 else
2056 if (sreg != PIC_CALL_REG)
2057 as_warn (_("MIPS PIC call to register other than $25"));
2059 + macro_build_jrpatch (&expr1, sreg);
2060 macro_build (NULL, "jalr", "d,s", dreg, sreg);
2061 if (mips_pic == SVR4_PIC && !HAVE_NEWABI)
2063 @@ -11243,6 +11346,8 @@
2064 OPTION_SINGLE_FLOAT,
2065 OPTION_DOUBLE_FLOAT,
2066 OPTION_32,
2067 + OPTION_TRAP_ZERO_JUMP,
2068 + OPTION_NO_TRAP_ZERO_JUMP,
2069 #ifdef OBJ_ELF
2070 OPTION_CALL_SHARED,
2071 OPTION_CALL_NONPIC,
2072 @@ -11257,6 +11362,8 @@
2073 OPTION_NO_PDR,
2074 OPTION_MVXWORKS_PIC,
2075 #endif /* OBJ_ELF */
2076 + OPTION_FIX_LOONGSON2F_BTB,
2077 + OPTION_NO_FIX_LOONGSON2F_BTB,
2078 OPTION_END_OF_ENUM
2081 @@ -11310,6 +11417,8 @@
2082 {"mno-fix-loongson2f-jump", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_JUMP},
2083 {"mfix-loongson2f-nop", no_argument, NULL, OPTION_FIX_LOONGSON2F_NOP},
2084 {"mno-fix-loongson2f-nop", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_NOP},
2085 + {"mfix-loongson2f-btb", no_argument, NULL, OPTION_FIX_LOONGSON2F_BTB},
2086 + {"mno-fix-loongson2f-btb", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_BTB},
2087 {"mfix-vr4120", no_argument, NULL, OPTION_FIX_VR4120},
2088 {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120},
2089 {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130},
2090 @@ -11348,6 +11457,9 @@
2091 make testing easier. */
2092 {"32", no_argument, NULL, OPTION_32},
2094 + {"mtrap-zero-jump", no_argument, NULL, OPTION_TRAP_ZERO_JUMP},
2095 + {"mno-trap-zero-jump", no_argument, NULL, OPTION_NO_TRAP_ZERO_JUMP},
2097 /* ELF-specific options. */
2098 #ifdef OBJ_ELF
2099 {"KPIC", no_argument, NULL, OPTION_CALL_SHARED},
2100 @@ -11611,6 +11723,14 @@
2101 mips_fix_vr4130 = 0;
2102 break;
2104 + case OPTION_FIX_LOONGSON2F_BTB:
2105 + mips_fix_loongson2f_btb = 1;
2106 + break;
2108 + case OPTION_NO_FIX_LOONGSON2F_BTB:
2109 + mips_fix_loongson2f_btb = 0;
2110 + break;
2112 case OPTION_FIX_CN63XXP1:
2113 mips_fix_cn63xxp1 = TRUE;
2114 break;
2115 @@ -11643,6 +11763,14 @@
2116 mips_opts.sym32 = FALSE;
2117 break;
2119 + case OPTION_TRAP_ZERO_JUMP:
2120 + mips_trap_zero_jump = TRUE;
2121 + break;
2123 + case OPTION_NO_TRAP_ZERO_JUMP:
2124 + mips_trap_zero_jump = FALSE;
2125 + break;
2127 #ifdef OBJ_ELF
2128 /* When generating ELF code, we permit -KPIC and -call_shared to
2129 select SVR4_PIC, and -non_shared to select no PIC. This is
2130 @@ -15587,6 +15715,7 @@
2131 fprintf (stream, _("\
2132 -mfix-loongson2f-jump work around Loongson2F JUMP instructions\n\
2133 -mfix-loongson2f-nop work around Loongson2F NOP errata\n\
2134 +-mfix-loongson2f-btb work around Loongson2F BTB errata\n\
2135 -mfix-vr4120 work around certain VR4120 errata\n\
2136 -mfix-vr4130 work around VR4130 mflo/mfhi errata\n\
2137 -mfix-24k insert a nop after ERET and DERET instructions\n\
2138 diff -rNU3 dist/gas/config/tc-vax.c dist.nbsd/gas/config/tc-vax.c
2139 --- dist/gas/config/tc-vax.c Wed Nov 7 11:43:31 2012
2140 +++ dist.nbsd/gas/config/tc-vax.c Wed Nov 7 11:13:46 2012
2141 @@ -392,6 +392,9 @@
2142 && (PLT_symbol == NULL || fragP->fr_symbol != PLT_symbol)
2143 && fragP->fr_symbol != NULL
2144 && flag_want_pic
2145 +#ifdef OBJ_ELF
2146 + && ELF_ST_VISIBILITY (S_GET_OTHER (fragP->fr_symbol)) != STV_HIDDEN
2147 +#endif
2148 && (!S_IS_DEFINED (fragP->fr_symbol)
2149 || S_IS_WEAK (fragP->fr_symbol)
2150 || S_IS_EXTERNAL (fragP->fr_symbol)))
2151 @@ -1073,6 +1076,154 @@
2152 return retval;
2155 +#ifdef OBJ_AOUT
2156 +#ifndef BFD_ASSEMBLER
2157 +void
2158 +tc_aout_fix_to_chars (where, fixP, segment_address_in_file)
2159 + char *where;
2160 + fixS *fixP;
2161 + relax_addressT segment_address_in_file;
2163 + /*
2164 + * In: length of relocation (or of address) in chars: 1, 2 or 4.
2165 + * Out: GNU LD relocation length code: 0, 1, or 2.
2166 + */
2168 + static const unsigned char nbytes_r_length[] = {42, 0, 1, 42, 2};
2169 + int r_symbolnum;
2170 + int r_flags;
2172 + know (fixP->fx_addsy != NULL);
2174 + md_number_to_chars (where,
2175 + fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
2176 + 4);
2178 + r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy)
2179 + ? S_GET_TYPE (fixP->fx_addsy)
2180 + : fixP->fx_addsy->sy_number);
2181 + r_flags = (fixP->fx_pcrel ? 1 : 0)
2182 + | (!S_IS_DEFINED (fixP->fx_addsy) ? 8 : 0) /* extern */
2183 + | ((nbytes_r_length[fixP->fx_size] & 3) << 1);
2185 +#if 0
2186 + r_flags |= ((!S_IS_DEFINED(fixP->fx_addsy)
2187 + && fixP->fx_pcrel
2188 + && fixP->fx_addsy != GOT_symbol
2189 + && fixP->fx_addsy != PLT_symbol
2190 + && flags_want_pic) ? 0x10 : 0);
2191 +#endif
2193 + switch (fixP->fx_r_type) {
2194 + case NO_RELOC:
2195 + break;
2196 + case NO_RELOC2:
2197 + if (r_flags & 8)
2198 + r_flags |= 0x80; /* setting the copy bit */
2199 + /* says we can convert */
2200 + /* to gotslot if needed */
2201 + break;
2202 + case RELOC_32:
2203 + if (flag_want_pic && S_IS_EXTERNAL(fixP->fx_addsy)) {
2204 + r_symbolnum = fixP->fx_addsy->sy_number;
2205 + r_flags |= 8; /* set extern bit */
2207 + break;
2208 + case RELOC_JMP_SLOT:
2209 + if (flag_want_pic) {
2210 + r_flags |= 0x20; /* set jmptable */
2211 + r_flags &= ~0x08; /* clear extern bit */
2213 + break;
2214 + case RELOC_JMP_TBL:
2215 + if (flag_want_pic) {
2216 + r_flags |= 0x20; /* set jmptable */
2217 + r_flags |= 0x08; /* set extern bit */
2219 + break;
2220 + case RELOC_GLOB_DAT:
2221 + if (flag_want_pic) {
2222 + r_flags |= 0x10; /* set baserel bit */
2223 + r_symbolnum = fixP->fx_addsy->sy_number;
2224 + if (S_IS_EXTERNAL(fixP->fx_addsy))
2225 + r_flags |= 8; /* set extern bit */
2227 + break;
2230 + where[4] = (r_symbolnum >> 0) & 0xff;
2231 + where[5] = (r_symbolnum >> 8) & 0xff;
2232 + where[6] = (r_symbolnum >> 16) & 0xff;
2233 + where[7] = r_flags;
2235 +#endif /* !BFD_ASSEMBLER */
2236 +#endif /* OBJ_AOUT */
2239 + * BUGS, GRIPES, APOLOGIA, etc.
2241 + * The opcode table 'votstrs' needs to be sorted on opcode frequency.
2242 + * That is, AFTER we hash it with hash_...(), we want most-used opcodes
2243 + * to come out of the hash table faster.
2245 + * I am sorry to inflict yet another VAX assembler on the world, but
2246 + * RMS says we must do everything from scratch, to prevent pin-heads
2247 + * restricting this software.
2248 + */
2251 + * This is a vaguely modular set of routines in C to parse VAX
2252 + * assembly code using DEC mnemonics. It is NOT un*x specific.
2254 + * The idea here is that the assembler has taken care of all:
2255 + * labels
2256 + * macros
2257 + * listing
2258 + * pseudo-ops
2259 + * line continuation
2260 + * comments
2261 + * condensing any whitespace down to exactly one space
2262 + * and all we have to do is parse 1 line into a vax instruction
2263 + * partially formed. We will accept a line, and deliver:
2264 + * an error message (hopefully empty)
2265 + * a skeleton VAX instruction (tree structure)
2266 + * textual pointers to all the operand expressions
2267 + * a warning message that notes a silly operand (hopefully empty)
2268 + */
2271 + * E D I T H I S T O R Y
2273 + * 17may86 Dean Elsner. Bug if line ends immediately after opcode.
2274 + * 30apr86 Dean Elsner. New vip_op() uses arg block so change call.
2275 + * 6jan86 Dean Elsner. Crock vip_begin() to call vip_op_defaults().
2276 + * 2jan86 Dean Elsner. Invent synthetic opcodes.
2277 + * Widen vax_opcodeT to 32 bits. Use a bit for VIT_OPCODE_SYNTHETIC,
2278 + * which means this is not a real opcode, it is like a macro; it will
2279 + * be relax()ed into 1 or more instructions.
2280 + * Use another bit for VIT_OPCODE_SPECIAL if the op-code is not optimised
2281 + * like a regular branch instruction. Option added to vip_begin():
2282 + * exclude synthetic opcodes. Invent synthetic_votstrs[].
2283 + * 31dec85 Dean Elsner. Invent vit_opcode_nbytes.
2284 + * Also make vit_opcode into a char[]. We now have n-byte vax opcodes,
2285 + * so caller's don't have to know the difference between a 1-byte & a
2286 + * 2-byte op-code. Still need vax_opcodeT concept, so we know how
2287 + * big an object must be to hold an op.code.
2288 + * 30dec85 Dean Elsner. Widen typedef vax_opcodeT in "vax-inst.h"
2289 + * because vax opcodes may be 16 bits. Our crufty C compiler was
2290 + * happily initialising 8-bit vot_codes with 16-bit numbers!
2291 + * (Wouldn't the 'phone company like to compress data so easily!)
2292 + * 29dec85 Dean Elsner. New static table vax_operand_width_size[].
2293 + * Invented so we know hw many bytes a "I^#42" needs in its immediate
2294 + * operand. Revised struct vop in "vax-inst.h": explicitly include
2295 + * byte length of each operand, and it's letter-code datum type.
2296 + * 17nov85 Dean Elsner. Name Change.
2297 + * Due to ar(1) truncating names, we learned the hard way that
2298 + * "vax-inst-parse.c" -> "vax-inst-parse." dropping the "o" off
2299 + * the archived object name. SO... we shortened the name of this
2300 + * source file, and changed the makefile.
2301 + */
2303 /* Parse a vax operand in DEC assembler notation.
2304 For speed, expect a string of whitespace to be reduced to a single ' '.
2305 This is the case for GNU AS, and is easy for other DEC-compatible
2306 @@ -3150,7 +3301,7 @@
2307 if (flag_want_pic && operandP->vop_mode == 8
2308 && this_add_symbol != NULL)
2310 - as_warn (_("Symbol %s used as immediate operand in PIC mode."),
2311 + as_warn (_("Symbol '%s' used as immediate operand in PIC mode."),
2312 S_GET_NAME (this_add_symbol));
2314 #endif
2315 @@ -3226,7 +3377,15 @@
2316 length = 4;
2319 +#ifdef OBJ_ELF
2320 + if (flag_want_pic && this_add_symbol != NULL)
2322 + as_warn (_("Symbol '%s' used as displacement in PIC mode."),
2323 + S_GET_NAME (this_add_symbol));
2325 +#endif
2326 p = frag_more (1 + length);
2327 + know (operandP->vop_reg != 0xf);
2328 know (operandP->vop_reg >= 0);
2329 p[0] = operandP->vop_reg
2330 | ((at | "?\12\14?\16"[length]) << 4);
2331 diff -rNU3 dist/gas/config/vax-inst.h dist.nbsd/gas/config/vax-inst.h
2332 --- dist/gas/config/vax-inst.h Wed Nov 7 11:43:31 2012
2333 +++ dist.nbsd/gas/config/vax-inst.h Wed Nov 7 11:13:46 2012
2334 @@ -66,6 +66,8 @@
2335 #define VAX_WIDEN_WORD (0x20) /* Add this to byte branch to get word br. */
2336 #define VAX_WIDEN_LONG (0x6) /* Add this to byte branch to get long jmp.*/
2337 /* Needs VAX_PC_RELATIVE_MODE byte after it*/
2338 +#define VAX_CALLS (0xFB) /* Call with arg list on stack */
2339 +#define VAX_CALLG (0xFA) /* Call with arg list in memory */
2341 struct vit /* vax instruction tree */
2343 diff -rNU3 dist/gas/doc/Makefile.am dist.nbsd/gas/doc/Makefile.am
2344 --- dist/gas/doc/Makefile.am Wed Nov 7 11:43:31 2012
2345 +++ dist.nbsd/gas/doc/Makefile.am Wed Nov 7 11:13:46 2012
2346 @@ -24,6 +24,8 @@
2347 -I "$(top_srcdir)/../bfd/doc" -I ../../bfd/doc
2349 asconfig.texi: $(CONFIG).texi
2350 + @echo "NOT REBUILDING $@"
2351 +NetBSD_DISABLED_asconfig.text:
2352 rm -f asconfig.texi
2353 cp $(srcdir)/$(CONFIG).texi ./asconfig.texi
2354 chmod u+w ./asconfig.texi
2355 @@ -96,6 +98,8 @@
2356 # The sed command removes the no-adjust Nroff command so that
2357 # the man output looks standard.
2358 as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS)
2359 + @echo "NOT REBUILDING $@"
2360 +NetBSD_DISABLED_as.1:
2361 touch $@
2362 -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod
2363 -($(POD2MAN) as.pod | \
2364 diff -rNU3 dist/gas/doc/Makefile.in dist.nbsd/gas/doc/Makefile.in
2365 --- dist/gas/doc/Makefile.in Wed Nov 7 11:43:31 2012
2366 +++ dist.nbsd/gas/doc/Makefile.in Wed Nov 7 11:13:46 2012
2367 @@ -366,6 +366,8 @@
2368 -rm -rf .libs _libs
2370 as.info: as.texinfo $(as_TEXINFOS)
2371 + @echo "NOT REBUILDING $@"
2372 +NetBSD_DISABLED_as.info: as.texinfo $(as_TEXINFOS)
2373 restore=: && backupdir="$(am__leading_dot)am$$$$" && \
2374 rm -rf $$backupdir && mkdir $$backupdir && \
2375 if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
2376 @@ -748,6 +750,8 @@
2379 asconfig.texi: $(CONFIG).texi
2380 + @echo "NOT REBUILDING $@"
2381 +NetBSD_DISABLED_asconfig.texi:
2382 rm -f asconfig.texi
2383 cp $(srcdir)/$(CONFIG).texi ./asconfig.texi
2384 chmod u+w ./asconfig.texi
2385 @@ -765,6 +769,8 @@
2386 # The sed command removes the no-adjust Nroff command so that
2387 # the man output looks standard.
2388 as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS)
2389 + @echo "NOT REBUILDING $@"
2390 +NetBSD_DISABLED_as.1:
2391 touch $@
2392 -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod
2393 -($(POD2MAN) as.pod | \
2394 Binary files dist/gas/doc/as.info and dist.nbsd/gas/doc/as.info differ
2395 diff -rNU3 dist/gas/doc/c-mips.texi dist.nbsd/gas/doc/c-mips.texi
2396 --- dist/gas/doc/c-mips.texi Wed Nov 7 11:43:31 2012
2397 +++ dist.nbsd/gas/doc/c-mips.texi Wed Nov 7 11:13:46 2012
2398 @@ -196,6 +196,14 @@
2399 @itemx -mno-fix-vr4130
2400 Insert nops to work around the VR4130 @samp{mflo}/@samp{mfhi} errata.
2402 +@item -mfix-loongson2f-btb
2403 +@itemx -mno-fix-loongson2f-btb
2404 +Clear the Branch Target Buffer before any jump through a register. This
2405 +option is intended to be used on kernel code for the Loongson 2F processor
2406 +only; userland code compiled with this option will fault, and kernel code
2407 +compiled with this option run on another processor than Loongson 2F will
2408 +yield unpredictable results.
2410 @item -mfix-24k
2411 @itemx -no-mfix-24k
2412 Insert nops to work around the 24K @samp{eret}/@samp{deret} errata.
2413 diff -rNU3 dist/gas/remap.c dist.nbsd/gas/remap.c
2414 --- dist/gas/remap.c Wed Nov 7 11:43:31 2012
2415 +++ dist.nbsd/gas/remap.c Wed Nov 7 11:13:50 2012
2416 @@ -82,8 +82,8 @@
2417 return filename;
2418 name = filename + map->old_len;
2419 name_len = strlen (name) + 1;
2420 - s = (char *) alloca (name_len + map->new_len);
2421 + s = (char *) xmalloc (name_len + map->new_len);
2422 memcpy (s, map->new_prefix, map->new_len);
2423 memcpy (s + map->new_len, name, name_len);
2424 - return xstrdup (s);
2425 + return s;
2427 diff -rNU3 dist/gprof/corefile.c dist.nbsd/gprof/corefile.c
2428 --- dist/gprof/corefile.c Wed Nov 7 11:43:28 2012
2429 +++ dist.nbsd/gprof/corefile.c Wed Nov 7 11:13:50 2012
2430 @@ -29,6 +29,8 @@
2431 #include "corefile.h"
2432 #include "safe-ctype.h"
2434 +#include <stdlib.h>
2436 bfd *core_bfd;
2437 static int core_num_syms;
2438 static asymbol **core_syms;
2439 diff -rNU3 dist/gprof/gprof.1 dist.nbsd/gprof/gprof.1
2440 --- dist/gprof/gprof.1 Wed Nov 7 11:43:28 2012
2441 +++ dist.nbsd/gprof/gprof.1 Wed Nov 7 11:13:50 2012
2442 @@ -1,15 +1,7 @@
2443 -.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
2444 +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
2446 .\" Standard preamble:
2447 .\" ========================================================================
2448 -.de Sh \" Subsection heading
2449 -.br
2450 -.if t .Sp
2451 -.ne 5
2452 -.PP
2453 -\fB\\$1\fR
2454 -.PP
2456 .de Sp \" Vertical space (when we can't use .PP)
2457 .if t .sp .5v
2458 .if n .sp
2459 @@ -53,7 +45,7 @@
2460 .el .ds Aq '
2462 .\" If the F register is turned on, we'll generate index entries on stderr for
2463 -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
2464 +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
2465 .\" entries marked with X<> in POD. Of course, you'll have to process the
2466 .\" output yourself in some meaningful fashion.
2467 .ie \nF \{\
2468 @@ -132,7 +124,7 @@
2469 .\" ========================================================================
2471 .IX Title "GPROF 1"
2472 -.TH GPROF 1 "2011-06-27" "binutils-2.21.1" "GNU"
2473 +.TH GPROF 1 "2011-09-24" "binutils-2.21.1" "GNU"
2474 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
2475 .\" way too many mistakes in technical documents.
2476 .if n .ad l
2477 @@ -475,7 +467,7 @@
2478 compilers have different mangling styles. The optional demangling style
2479 argument can be used to choose an appropriate demangling style for your
2480 compiler.
2481 -.Sh "Analysis Options"
2482 +.SS "Analysis Options"
2483 .IX Subsection "Analysis Options"
2484 .ie n .IP """\-a""" 4
2485 .el .IP "\f(CW\-a\fR" 4
2486 @@ -604,7 +596,7 @@
2487 functions in the flat profile, even those that were never called, and
2488 that had no time spent in them. This is useful in conjunction with the
2489 \&\fB\-c\fR option for discovering which routines were never called.
2490 -.Sh "Miscellaneous Options"
2491 +.SS "Miscellaneous Options"
2492 .IX Subsection "Miscellaneous Options"
2493 .ie n .IP """\-d[\f(CInum\f(CW]""" 4
2494 .el .IP "\f(CW\-d[\f(CInum\f(CW]\fR" 4
2495 @@ -663,7 +655,7 @@
2497 The \fB\-v\fR flag causes \f(CW\*(C`gprof\*(C'\fR to print the current version
2498 number, and then exit.
2499 -.Sh "Deprecated Options"
2500 +.SS "Deprecated Options"
2501 .IX Subsection "Deprecated Options"
2502 These options have been replaced with newer versions that use symspecs.
2503 .ie n .IP """\-e \f(CIfunction_name\f(CW""" 4
2504 diff -rNU3 dist/gprof/gprof.c dist.nbsd/gprof/gprof.c
2505 --- dist/gprof/gprof.c Wed Nov 7 11:43:28 2012
2506 +++ dist.nbsd/gprof/gprof.c Wed Nov 7 11:13:50 2012
2507 @@ -47,6 +47,8 @@
2509 static void usage (FILE *, int) ATTRIBUTE_NORETURN;
2511 +#include <stdlib.h>
2513 const char * whoami;
2514 const char * function_mapping_file;
2515 static const char * external_symbol_table;
2516 Binary files dist/gprof/gprof.info and dist.nbsd/gprof/gprof.info differ
2517 diff -rNU3 dist/include/bfdlink.h dist.nbsd/include/bfdlink.h
2518 --- dist/include/bfdlink.h Wed Nov 7 11:43:28 2012
2519 +++ dist.nbsd/include/bfdlink.h Wed Nov 7 11:13:45 2012
2520 @@ -403,6 +403,10 @@
2521 option). If this is NULL, no symbols are being wrapped. */
2522 struct bfd_hash_table *wrap_hash;
2524 + /* Hash table of symbols which may be left unresolved during
2525 + a link. If this is NULL, no symbols can be left unresolved. */
2526 + struct bfd_hash_table *ignore_hash;
2528 /* The output BFD. */
2529 bfd *output_bfd;
2531 diff -rNU3 dist/include/opcode/mips.h dist.nbsd/include/opcode/mips.h
2532 --- dist/include/opcode/mips.h Wed Nov 7 11:43:28 2012
2533 +++ dist.nbsd/include/opcode/mips.h Wed Nov 7 11:13:45 2012
2534 @@ -768,7 +768,11 @@
2535 M_DSUB_I,
2536 M_DSUBU_I,
2537 M_DSUBU_I_2,
2538 + M_JR_S,
2539 + M_J_S,
2540 M_J_A,
2541 + M_JALR_S,
2542 + M_JALR_DS,
2543 M_JAL_1,
2544 M_JAL_2,
2545 M_JAL_A,
2546 diff -rNU3 dist/ld/Makefile.am dist.nbsd/ld/Makefile.am
2547 --- dist/ld/Makefile.am Wed Nov 7 11:43:28 2012
2548 +++ dist.nbsd/ld/Makefile.am Wed Nov 7 11:13:51 2012
2549 @@ -144,11 +144,13 @@
2550 earmelf_linux.c \
2551 earmelf_linux_eabi.c \
2552 earmelf_nbsd.c \
2553 + earmelf_nbsd_eabi.c \
2554 earmelf_vxworks.c \
2555 earmelfb.c \
2556 earmelfb_linux.c \
2557 earmelfb_linux_eabi.c \
2558 earmelfb_nbsd.c \
2559 + earmelfb_nbsd_eabi.c \
2560 earmnbsd.c \
2561 earmnto.c \
2562 earmpe.c \
2563 @@ -684,6 +686,11 @@
2564 $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
2565 $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2566 ${GENSCRIPTS} armelf_nbsd "$(tdir_armelf_nbsd)"
2567 +earmelf_nbsd_abi.c: $(srcdir)/emulparams/armelf_nbsd_abi.sh \
2568 + $(srcdir)/emulparams/armelf.sh \
2569 + $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
2570 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2571 + ${GENSCRIPTS} armelf_nbsd_abi "$(tdir_armelf_nbsd_abi)"
2572 earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
2573 $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
2574 $(ELF_DEPS) $(srcdir)/emultempl/vxworks.em \
2575 @@ -711,6 +718,12 @@
2576 $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
2577 $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2578 ${GENSCRIPTS} armelfb_nbsd "$(tdir_armelfb_nbsd)"
2579 +earmelfb_nbsd_abi.c: $(srcdir)/emulparams/armelfb_nbsd_abi.sh \
2580 + $(srcdir)/emulparams/armelf_nbsd_abi.sh \
2581 + $(srcdir)/emulparams/armelf.sh \
2582 + $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
2583 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2584 + ${GENSCRIPTS} armelfb_nbsd_abi "$(tdir_armelfb_nbsd_abi)"
2585 earmnbsd.c: $(srcdir)/emulparams/armnbsd.sh \
2586 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
2587 ${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
2588 @@ -2009,6 +2022,8 @@
2589 # because almost all configs use "gen" version of manual.
2590 # Set DOCVER above to change.
2591 configdoc.texi: ${DOCVER}-doc.texi
2592 + @echo "NOT REBUILDING $@"
2593 +NetBSD_DISABLED_configdoc.texi:
2594 cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
2595 chmod u+w ./configdoc.texi
2597 @@ -2016,6 +2031,8 @@
2598 # The sed command removes the no-adjust Nroff command so that
2599 # the man output looks standard.
2600 ld.1: $(srcdir)/ld.texinfo configdoc.texi
2601 + @echo "NOT REBUILDING $@"
2602 +NetBSD_DISABLED_ld.1:
2603 touch $@
2604 -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod
2605 -($(POD2MAN) ld.pod | \
2606 diff -rNU3 dist/ld/Makefile.in dist.nbsd/ld/Makefile.in
2607 --- dist/ld/Makefile.in Wed Nov 7 11:43:28 2012
2608 +++ dist.nbsd/ld/Makefile.in Wed Nov 7 11:13:51 2012
2609 @@ -449,11 +449,13 @@
2610 earmelf_linux.c \
2611 earmelf_linux_eabi.c \
2612 earmelf_nbsd.c \
2613 + earmelf_nbsd_eabi.c \
2614 earmelf_vxworks.c \
2615 earmelfb.c \
2616 earmelfb_linux.c \
2617 earmelfb_linux_eabi.c \
2618 earmelfb_nbsd.c \
2619 + earmelfb_nbsd_eabi.c \
2620 earmnbsd.c \
2621 earmnto.c \
2622 earmpe.c \
2623 @@ -1031,11 +1033,13 @@
2624 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux.Po@am__quote@
2625 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_eabi.Po@am__quote@
2626 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd.Po@am__quote@
2627 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd_abi.Po@am__quote@
2628 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_vxworks.Po@am__quote@
2629 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb.Po@am__quote@
2630 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_linux.Po@am__quote@
2631 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_linux_eabi.Po@am__quote@
2632 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nbsd.Po@am__quote@
2633 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nbsd_eabi.Po@am__quote@
2634 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmnbsd.Po@am__quote@
2635 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmnto.Po@am__quote@
2636 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmpe.Po@am__quote@
2637 @@ -1415,6 +1419,8 @@
2638 -rm -f libtool config.lt
2640 ld.info: ld.texinfo $(ld_TEXINFOS)
2641 + @echo "NOT REBUILDING $@"
2642 +NetBSD_DISABLED_ld.info: ld.texinfo $(ld_TEXINFOS)
2643 restore=: && backupdir="$(am__leading_dot)am$$$$" && \
2644 rm -rf $$backupdir && mkdir $$backupdir && \
2645 if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
2646 @@ -2119,6 +2125,11 @@
2647 $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
2648 $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2649 ${GENSCRIPTS} armelf_nbsd "$(tdir_armelf_nbsd)"
2650 +earmelf_nbsd_eabi.c: $(srcdir)/emulparams/armelf_nbsd_eabi.sh \
2651 + $(srcdir)/emulparams/armelf.sh \
2652 + $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
2653 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2654 + ${GENSCRIPTS} armelf_nbsd_eabi "$(tdir_armelf_nbsd_eabi)"
2655 earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
2656 $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
2657 $(ELF_DEPS) $(srcdir)/emultempl/vxworks.em \
2658 @@ -2146,6 +2157,12 @@
2659 $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
2660 $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2661 ${GENSCRIPTS} armelfb_nbsd "$(tdir_armelfb_nbsd)"
2662 +earmelfb_nbsd_eabi.c: $(srcdir)/emulparams/armelfb_nbsd_eabi.sh \
2663 + $(srcdir)/emulparams/armelf_nbsd_eabi.sh \
2664 + $(srcdir)/emulparams/armelf.sh \
2665 + $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
2666 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2667 + ${GENSCRIPTS} armelfb_nbsd_eabi "$(tdir_armelfb_nbsd_eabi)"
2668 earmnbsd.c: $(srcdir)/emulparams/armnbsd.sh \
2669 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
2670 ${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
2671 @@ -3387,6 +3404,8 @@
2672 # because almost all configs use "gen" version of manual.
2673 # Set DOCVER above to change.
2674 configdoc.texi: ${DOCVER}-doc.texi
2675 + @echo "NOT REBUILDING $@"
2676 +NetBSD_DISABLED_configdoc.texi:
2677 cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
2678 chmod u+w ./configdoc.texi
2680 @@ -3394,6 +3413,8 @@
2681 # The sed command removes the no-adjust Nroff command so that
2682 # the man output looks standard.
2683 ld.1: $(srcdir)/ld.texinfo configdoc.texi
2684 + @echo "NOT REBUILDING $@"
2685 +NetBSD_DISABLED_ld.1:
2686 touch $@
2687 -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod
2688 -($(POD2MAN) ld.pod | \
2689 diff -rNU3 dist/ld/configure.tgt dist.nbsd/ld/configure.tgt
2690 --- dist/ld/configure.tgt Wed Nov 7 11:43:28 2012
2691 +++ dist.nbsd/ld/configure.tgt Wed Nov 7 11:13:51 2012
2692 @@ -56,6 +56,11 @@
2693 arm-*-freebsd* | arm-*-kfreebsd*-gnu)
2694 targ_emul=armelf_fbsd
2695 targ_extra_emuls="armelf" ;;
2696 +armeb-*-netbsdelf*-eabi*)
2697 + targ_emul=armelfb_nbsd_eabi;
2698 + targ_extra_emuls="armelf_nbsd_eabi armelf armnbsd" ;;
2699 +arm-*-netbsdelf*-eabi*) targ_emul=armelf_nbsd_eabi;
2700 + targ_extra_emuls="armelfb_nbsd_eabi armelf armnbsd" ;;
2701 armeb-*-netbsdelf*) targ_emul=armelfb_nbsd;
2702 targ_extra_emuls="armelf_nbsd armelf armnbsd" ;;
2703 arm-*-netbsdelf*) targ_emul=armelf_nbsd;
2704 @@ -379,12 +384,18 @@
2705 mips*-sgi-irix*) targ_emul=mipsbig ;;
2706 mips*el-*-ecoff*) targ_emul=mipsidtl ;;
2707 mips*-*-ecoff*) targ_emul=mipsidt ;;
2708 +mips64*el-*-netbsd*) targ_emul=elf32ltsmipn32
2709 + targ_extra_emuls="elf64btsmip elf64ltsmip elf32ltsmip elf32btsmipn32 elf32btsmip"
2710 + ;;
2711 +mips64*-*-netbsd*) targ_emul=elf32btsmipn32
2712 + targ_extra_emuls="elf64ltsmip elf64btsmip elf32btsmip elf32ltsmipn32 elf32ltsmip"
2713 + ;;
2714 mips*el-*-netbsd*) targ_emul=elf32ltsmip
2715 targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
2717 mips*-*-netbsd*) targ_emul=elf32btsmip
2718 targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
2719 - ;;
2720 + ;;
2721 mips*-*-bsd*) targ_emul=mipsbig ;;
2722 mips*vr4300el-*-elf*) targ_emul=elf32l4300 ;;
2723 mips*vr4300-*-elf*) targ_emul=elf32b4300 ;;
2724 @@ -600,10 +611,15 @@
2725 tdir_sparclinux=${targ_alias}aout
2726 tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
2727 tdir_sun4=sparc-sun-sunos4 ;;
2728 -sparc64-*-netbsd* | sparc64-*-openbsd*)
2729 - targ_emul=elf64_sparc
2730 - targ_extra_emuls="elf32_sparc" ;;
2731 -sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ;;
2732 +sparc64-*-netbsd*) targ_emul=elf64_sparc
2733 + targ_extra_emuls="elf32_sparc sparcnbsd"
2734 + ;;
2735 +sparc64-*-openbsd*) targ_emul=elf64_sparc
2736 + targ_extra_emuls="elf32_sparc"
2737 + ;;
2738 +sparc*-*-netbsd*elf*) targ_emul=elf32_sparc
2739 + targ_extra_emuls=sparcnbsd
2740 + ;;
2741 sparc*-*-netbsd*) targ_emul=sparcnbsd ;;
2742 sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
2743 targ_emul=elf32_sparc_sol2
2744 diff -rNU3 dist/ld/emulparams/armelf_nbsd.sh dist.nbsd/ld/emulparams/armelf_nbsd.sh
2745 --- dist/ld/emulparams/armelf_nbsd.sh Wed Nov 7 11:43:28 2012
2746 +++ dist.nbsd/ld/emulparams/armelf_nbsd.sh Wed Nov 7 11:13:50 2012
2747 @@ -3,5 +3,12 @@
2748 TEXT_START_ADDR=0x00008000
2749 TARGET2_TYPE=got-rel
2751 +unset DATA_START_SYMBOLS
2752 unset STACK_ADDR
2753 unset EMBEDDED
2755 +case "$target" in
2756 + arm*-*-netbsdelf*-eabi*)
2757 + LIB_PATH='=/usr/lib/oabi'
2758 + ;;
2759 +esac
2760 diff -rNU3 dist/ld/emulparams/armelf_nbsd_eabi.sh dist.nbsd/ld/emulparams/armelf_nbsd_eabi.sh
2761 --- dist/ld/emulparams/armelf_nbsd_eabi.sh Thu Jan 1 00:00:00 1970
2762 +++ dist.nbsd/ld/emulparams/armelf_nbsd_eabi.sh Wed Nov 7 11:13:50 2012
2763 @@ -0,0 +1,18 @@
2764 +. ${srcdir}/emulparams/armelf_nbsd.sh
2766 +# Use the ARM ABI-compliant exception-handling sections.
2767 +OTHER_READONLY_SECTIONS="
2768 + .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) }
2769 + ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); }
2770 + .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) }
2771 + ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }"
2773 +unset LIB_PATH
2775 +case "$target" in
2776 + arm*-*-netbsdelf*-eabi*)
2777 + ;;
2778 + arm*-*-netbsdelf*)
2779 + LIB_PATH='=/usr/lib/eabi'
2780 + ;;
2781 +esac
2782 diff -rNU3 dist/ld/emulparams/armelfb_nbsd_eabi.sh dist.nbsd/ld/emulparams/armelfb_nbsd_eabi.sh
2783 --- dist/ld/emulparams/armelfb_nbsd_eabi.sh Thu Jan 1 00:00:00 1970
2784 +++ dist.nbsd/ld/emulparams/armelfb_nbsd_eabi.sh Wed Nov 7 11:13:50 2012
2785 @@ -0,0 +1,2 @@
2786 +. ${srcdir}/emulparams/armelf_nbsd_eabi.sh
2787 +OUTPUT_FORMAT="elf32-bigarm"
2788 diff -rNU3 dist/ld/emulparams/elf32_sparc.sh dist.nbsd/ld/emulparams/elf32_sparc.sh
2789 --- dist/ld/emulparams/elf32_sparc.sh Wed Nov 7 11:43:28 2012
2790 +++ dist.nbsd/ld/emulparams/elf32_sparc.sh Wed Nov 7 11:13:50 2012
2791 @@ -13,6 +13,7 @@
2792 TEMPLATE_NAME=elf32
2793 DATA_PLT=
2794 GENERATE_SHLIB_SCRIPT=yes
2795 +#ELFSIZE=32
2796 GENERATE_PIE_SCRIPT=yes
2797 NOP=0x01000000
2798 NO_SMALL_DATA=yes
2799 diff -rNU3 dist/ld/emulparams/elf32bmipn32-defs.sh dist.nbsd/ld/emulparams/elf32bmipn32-defs.sh
2800 --- dist/ld/emulparams/elf32bmipn32-defs.sh Wed Nov 7 11:43:28 2012
2801 +++ dist.nbsd/ld/emulparams/elf32bmipn32-defs.sh Wed Nov 7 11:13:50 2012
2802 @@ -6,6 +6,7 @@
2804 # Handle both big- and little-ended 32-bit MIPS objects.
2805 ARCH=mips
2806 +MACHINE=
2807 OUTPUT_FORMAT="elf32-bigmips"
2808 BIG_OUTPUT_FORMAT="elf32-bigmips"
2809 LITTLE_OUTPUT_FORMAT="elf32-littlemips"
2810 diff -rNU3 dist/ld/emulparams/elf64alpha_nbsd.sh dist.nbsd/ld/emulparams/elf64alpha_nbsd.sh
2811 --- dist/ld/emulparams/elf64alpha_nbsd.sh Wed Nov 7 11:43:28 2012
2812 +++ dist.nbsd/ld/emulparams/elf64alpha_nbsd.sh Wed Nov 7 11:13:50 2012
2813 @@ -1,2 +1,8 @@
2814 . ${srcdir}/emulparams/elf64alpha.sh
2815 ENTRY=__start
2817 +NOP=0x47ff041f
2818 +# XXX binutils 2.13
2819 +# Note that the number is always big-endian, thus we have to
2820 +# reverse the digit string.
2821 +#NOP=0x0000fe2f1f04ff47 # unop; nop
2822 diff -rNU3 dist/ld/emulparams/elf_i386.sh dist.nbsd/ld/emulparams/elf_i386.sh
2823 --- dist/ld/emulparams/elf_i386.sh Wed Nov 7 11:43:28 2012
2824 +++ dist.nbsd/ld/emulparams/elf_i386.sh Wed Nov 7 11:13:50 2012
2825 @@ -9,7 +9,14 @@
2826 NOP=0x90909090
2827 TEMPLATE_NAME=elf32
2828 GENERATE_SHLIB_SCRIPT=yes
2829 +#ELFSIZE=32
2830 GENERATE_PIE_SCRIPT=yes
2831 NO_SMALL_DATA=yes
2832 SEPARATE_GOTPLT=12
2833 IREL_IN_PLT=
2835 +case "$target" in
2836 + x86_64-*-netbsd*)
2837 + LIB_PATH='=/usr/lib/i386'
2838 + ;;
2839 +esac
2840 diff -rNU3 dist/ld/emulparams/hppalinux.sh dist.nbsd/ld/emulparams/hppalinux.sh
2841 --- dist/ld/emulparams/hppalinux.sh Wed Nov 7 11:43:28 2012
2842 +++ dist.nbsd/ld/emulparams/hppalinux.sh Wed Nov 7 11:13:50 2012
2843 @@ -1,5 +1,5 @@
2844 # If you change this file, please also look at files which source this one:
2845 -# hppanbsd.sh
2846 +# hppanbsd.sh hppaobsd.sh
2848 SCRIPT_NAME=elf
2849 ELFSIZE=32
2850 diff -rNU3 dist/ld/emulparams/hppaobsd.sh dist.nbsd/ld/emulparams/hppaobsd.sh
2851 --- dist/ld/emulparams/hppaobsd.sh Wed Nov 7 11:43:28 2012
2852 +++ dist.nbsd/ld/emulparams/hppaobsd.sh Wed Nov 7 11:13:50 2012
2853 @@ -1,4 +1,4 @@
2854 -. ${srcdir}/emulparams/hppanbsd.sh
2855 +. ${srcdir}/emulparams/hppalinux.sh
2857 OUTPUT_FORMAT="elf32-hppa"
2858 TEXT_START_ADDR=0x1000
2859 diff -rNU3 dist/ld/emulparams/m68kelf.sh dist.nbsd/ld/emulparams/m68kelf.sh
2860 --- dist/ld/emulparams/m68kelf.sh Wed Nov 7 11:43:28 2012
2861 +++ dist.nbsd/ld/emulparams/m68kelf.sh Wed Nov 7 11:13:50 2012
2862 @@ -10,5 +10,6 @@
2863 TEMPLATE_NAME=elf32
2864 EXTRA_EM_FILE=m68kelf
2865 GENERATE_SHLIB_SCRIPT=yes
2866 +ELFSIZE=32
2867 GENERATE_PIE_SCRIPT=yes
2868 NO_SMALL_DATA=yes
2869 diff -rNU3 dist/ld/emulparams/m68kelfnbsd.sh dist.nbsd/ld/emulparams/m68kelfnbsd.sh
2870 --- dist/ld/emulparams/m68kelfnbsd.sh Wed Nov 7 11:43:28 2012
2871 +++ dist.nbsd/ld/emulparams/m68kelfnbsd.sh Wed Nov 7 11:13:50 2012
2872 @@ -1,4 +1,4 @@
2873 . ${srcdir}/emulparams/m68kelf.sh
2874 TEXT_START_ADDR=0x2000
2875 TARGET_PAGE_SIZE=0x2000
2876 -MACHINE=
2877 +NONPAGED_TEXT_START_ADDR=${TEXT_START_ADDR}
2878 diff -rNU3 dist/ld/emulparams/sh.sh dist.nbsd/ld/emulparams/sh.sh
2879 --- dist/ld/emulparams/sh.sh Wed Nov 7 11:43:28 2012
2880 +++ dist.nbsd/ld/emulparams/sh.sh Wed Nov 7 11:13:50 2012
2881 @@ -3,6 +3,6 @@
2883 SCRIPT_NAME=sh
2884 OUTPUT_FORMAT="coff-sh"
2885 -TEXT_START_ADDR=0x8000
2886 -TARGET_PAGE_SIZE=128
2887 +TEXT_START_ADDR=0x1000
2888 +TARGET_PAGE_SIZE=0x1000
2889 ARCH=sh
2890 diff -rNU3 dist/ld/emulparams/shelf_nbsd.sh dist.nbsd/ld/emulparams/shelf_nbsd.sh
2891 --- dist/ld/emulparams/shelf_nbsd.sh Wed Nov 7 11:43:28 2012
2892 +++ dist.nbsd/ld/emulparams/shelf_nbsd.sh Wed Nov 7 11:13:50 2012
2893 @@ -9,7 +9,11 @@
2895 DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
2897 -ENTRY=_start
2898 +ENTRY=__start
2900 unset EMBEDDED
2901 unset OTHER_SECTIONS
2903 +OTHER_READWRITE_SECTIONS='
2904 + .note.ABI-tag : { *(.note.ABI-tag) }
2906 diff -rNU3 dist/ld/ldlex.c dist.nbsd/ld/ldlex.c
2907 --- dist/ld/ldlex.c Wed Nov 7 11:43:28 2012
2908 +++ dist.nbsd/ld/ldlex.c Wed Nov 7 11:13:50 2012
2909 @@ -16,6 +16,9 @@
2910 /* First, we deal with platform-specific or compiler-specific issues. */
2912 /* begin standard C headers. */
2913 +#ifdef _LIBC
2914 +#include "namespace.h"
2915 +#endif
2916 #include <stdio.h>
2917 #include <string.h>
2918 #include <errno.h>
2919 @@ -23,6 +26,8 @@
2921 /* end standard C headers. */
2923 +/* $NetBSD: ldlex.c,v 1.2 2011/09/25 04:32:43 christos Exp $ */
2925 /* flex integer type definitions */
2927 #ifndef FLEXINT_H
2928 @@ -152,13 +157,8 @@
2929 typedef struct yy_buffer_state *YY_BUFFER_STATE;
2930 #endif
2932 -#ifndef YY_TYPEDEF_YY_SIZE_T
2933 -#define YY_TYPEDEF_YY_SIZE_T
2934 -typedef size_t yy_size_t;
2935 -#endif
2936 +extern int yyleng;
2938 -extern yy_size_t yyleng;
2940 extern FILE *yyin, *yyout;
2942 #define EOB_ACT_CONTINUE_SCAN 0
2943 @@ -183,6 +183,11 @@
2945 #define unput(c) yyunput( c, (yytext_ptr) )
2947 +#ifndef YY_TYPEDEF_YY_SIZE_T
2948 +#define YY_TYPEDEF_YY_SIZE_T
2949 +typedef size_t yy_size_t;
2950 +#endif
2952 #ifndef YY_STRUCT_YY_BUFFER_STATE
2953 #define YY_STRUCT_YY_BUFFER_STATE
2954 struct yy_buffer_state
2955 @@ -200,7 +205,7 @@
2956 /* Number of characters read into yy_ch_buf, not including EOB
2957 * characters.
2959 - yy_size_t yy_n_chars;
2960 + int yy_n_chars;
2962 /* Whether we "own" the buffer - i.e., we know we created it,
2963 * and can realloc() it to grow it, and should free() it to
2964 @@ -270,8 +275,8 @@
2966 /* yy_hold_char holds the character lost when yytext is formed. */
2967 static char yy_hold_char;
2968 -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
2969 -yy_size_t yyleng;
2970 +static int yy_n_chars; /* number of characters read into yy_ch_buf */
2971 +int yyleng;
2973 /* Points to current character in buffer. */
2974 static char *yy_c_buf_p = (char *) 0;
2975 @@ -299,7 +304,7 @@
2977 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
2978 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
2979 -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
2980 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
2982 void *yyalloc (yy_size_t );
2983 void *yyrealloc (void *,yy_size_t );
2984 @@ -347,6 +352,9 @@
2985 static yy_state_type yy_get_previous_state (void );
2986 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
2987 static int yy_get_next_buffer (void );
2988 +#if defined(__GNUC__) && __GNUC__ >= 3
2989 +__attribute__((__noreturn__))
2990 +#endif
2991 static void yy_fatal_error (yyconst char msg[] );
2993 /* Done after the current pattern has been matched and before the
2994 @@ -1621,10 +1629,6 @@
2995 #undef YY_INPUT
2996 #define YY_INPUT(buf,result,max_size) result = yy_input (buf, max_size)
2998 -#ifndef YY_NO_UNPUT
2999 -#define YY_NO_UNPUT
3000 -#endif
3002 #define MAX_INCLUDE_DEPTH 10
3003 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
3004 static const char *file_name_stack[MAX_INCLUDE_DEPTH];
3005 @@ -1660,7 +1664,7 @@
3009 -#line 1664 "ldlex.c"
3010 +#line 1668 "ldlex.c"
3012 #define INITIAL 0
3013 #define SCRIPT 1
3014 @@ -1701,19 +1705,19 @@
3016 FILE *yyget_in (void );
3018 -void yyset_in (FILE * in_str );
3019 +void yyset_in (FILE * _in_str );
3021 FILE *yyget_out (void );
3023 -void yyset_out (FILE * out_str );
3024 +void yyset_out (FILE * _out_str );
3026 -yy_size_t yyget_leng (void );
3027 +int yyget_leng (void );
3029 char *yyget_text (void );
3031 int yyget_lineno (void );
3033 -void yyset_lineno (int line_number );
3034 +void yyset_lineno (int _line_number );
3036 /* Macros after this point can all be overridden by user definitions in
3037 * section 1.
3038 @@ -1727,6 +1731,10 @@
3039 #endif
3040 #endif
3042 +#ifndef YY_NO_UNPUT
3044 +#endif
3046 #ifndef yytext_ptr
3047 static void yy_flex_strncpy (char *,yyconst char *,int );
3048 #endif
3049 @@ -1766,7 +1774,7 @@
3050 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
3052 int c = '*'; \
3053 - yy_size_t n; \
3054 + size_t n; \
3055 for ( n = 0; n < max_size && \
3056 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
3057 buf[n] = (char) c; \
3058 @@ -1848,7 +1856,7 @@
3059 register char *yy_cp, *yy_bp;
3060 register int yy_act;
3062 -#line 120 "ldlex.l"
3063 +#line 118 "ldlex.l"
3066 if (parser_input != input_selected)
3067 @@ -1867,7 +1875,7 @@
3071 -#line 1871 "ldlex.c"
3072 +#line 1879 "ldlex.c"
3074 if ( !(yy_init) )
3076 @@ -1952,32 +1960,32 @@
3078 case 1:
3079 YY_RULE_SETUP
3080 -#line 138 "ldlex.l"
3081 +#line 136 "ldlex.l"
3082 { comment (); }
3083 YY_BREAK
3084 case 2:
3085 YY_RULE_SETUP
3086 -#line 141 "ldlex.l"
3087 +#line 139 "ldlex.l"
3088 { RTOKEN('-');}
3089 YY_BREAK
3090 case 3:
3091 YY_RULE_SETUP
3092 -#line 142 "ldlex.l"
3093 +#line 140 "ldlex.l"
3094 { RTOKEN('+');}
3095 YY_BREAK
3096 case 4:
3097 YY_RULE_SETUP
3098 -#line 143 "ldlex.l"
3099 +#line 141 "ldlex.l"
3100 { yylval.name = xstrdup (yytext); return NAME; }
3101 YY_BREAK
3102 case 5:
3103 YY_RULE_SETUP
3104 -#line 144 "ldlex.l"
3105 +#line 142 "ldlex.l"
3106 { RTOKEN('='); }
3107 YY_BREAK
3108 case 6:
3109 YY_RULE_SETUP
3110 -#line 146 "ldlex.l"
3111 +#line 144 "ldlex.l"
3113 yylval.integer = bfd_scan_vma (yytext + 1, 0, 16);
3114 yylval.bigint.str = NULL;
3115 @@ -1986,7 +1994,7 @@
3116 YY_BREAK
3117 case 7:
3118 YY_RULE_SETUP
3119 -#line 152 "ldlex.l"
3120 +#line 150 "ldlex.l"
3122 int ibase ;
3123 switch (yytext[yyleng - 1]) {
3124 @@ -2015,7 +2023,7 @@
3125 YY_BREAK
3126 case 8:
3127 YY_RULE_SETUP
3128 -#line 177 "ldlex.l"
3129 +#line 175 "ldlex.l"
3131 char *s = yytext;
3132 int ibase = 0;
3133 @@ -2048,794 +2056,794 @@
3134 YY_BREAK
3135 case 9:
3136 YY_RULE_SETUP
3137 -#line 206 "ldlex.l"
3138 +#line 204 "ldlex.l"
3139 { RTOKEN(']');}
3140 YY_BREAK
3141 case 10:
3142 YY_RULE_SETUP
3143 -#line 207 "ldlex.l"
3144 +#line 205 "ldlex.l"
3145 { RTOKEN('[');}
3146 YY_BREAK
3147 case 11:
3148 YY_RULE_SETUP
3149 -#line 208 "ldlex.l"
3150 +#line 206 "ldlex.l"
3151 { RTOKEN(LSHIFTEQ);}
3152 YY_BREAK
3153 case 12:
3154 YY_RULE_SETUP
3155 -#line 209 "ldlex.l"
3156 +#line 207 "ldlex.l"
3157 { RTOKEN(RSHIFTEQ);}
3158 YY_BREAK
3159 case 13:
3160 YY_RULE_SETUP
3161 -#line 210 "ldlex.l"
3162 +#line 208 "ldlex.l"
3163 { RTOKEN(OROR);}
3164 YY_BREAK
3165 case 14:
3166 YY_RULE_SETUP
3167 -#line 211 "ldlex.l"
3168 +#line 209 "ldlex.l"
3169 { RTOKEN(EQ);}
3170 YY_BREAK
3171 case 15:
3172 YY_RULE_SETUP
3173 -#line 212 "ldlex.l"
3174 +#line 210 "ldlex.l"
3175 { RTOKEN(NE);}
3176 YY_BREAK
3177 case 16:
3178 YY_RULE_SETUP
3179 -#line 213 "ldlex.l"
3180 +#line 211 "ldlex.l"
3181 { RTOKEN(GE);}
3182 YY_BREAK
3183 case 17:
3184 YY_RULE_SETUP
3185 -#line 214 "ldlex.l"
3186 +#line 212 "ldlex.l"
3187 { RTOKEN(LE);}
3188 YY_BREAK
3189 case 18:
3190 YY_RULE_SETUP
3191 -#line 215 "ldlex.l"
3192 +#line 213 "ldlex.l"
3193 { RTOKEN(LSHIFT);}
3194 YY_BREAK
3195 case 19:
3196 YY_RULE_SETUP
3197 -#line 216 "ldlex.l"
3198 +#line 214 "ldlex.l"
3199 { RTOKEN(RSHIFT);}
3200 YY_BREAK
3201 case 20:
3202 YY_RULE_SETUP
3203 -#line 217 "ldlex.l"
3204 +#line 215 "ldlex.l"
3205 { RTOKEN(PLUSEQ);}
3206 YY_BREAK
3207 case 21:
3208 YY_RULE_SETUP
3209 -#line 218 "ldlex.l"
3210 +#line 216 "ldlex.l"
3211 { RTOKEN(MINUSEQ);}
3212 YY_BREAK
3213 case 22:
3214 YY_RULE_SETUP
3215 -#line 219 "ldlex.l"
3216 +#line 217 "ldlex.l"
3217 { RTOKEN(MULTEQ);}
3218 YY_BREAK
3219 case 23:
3220 YY_RULE_SETUP
3221 -#line 220 "ldlex.l"
3222 +#line 218 "ldlex.l"
3223 { RTOKEN(DIVEQ);}
3224 YY_BREAK
3225 case 24:
3226 YY_RULE_SETUP
3227 -#line 221 "ldlex.l"
3228 +#line 219 "ldlex.l"
3229 { RTOKEN(ANDEQ);}
3230 YY_BREAK
3231 case 25:
3232 YY_RULE_SETUP
3233 -#line 222 "ldlex.l"
3234 +#line 220 "ldlex.l"
3235 { RTOKEN(OREQ);}
3236 YY_BREAK
3237 case 26:
3238 YY_RULE_SETUP
3239 -#line 223 "ldlex.l"
3240 +#line 221 "ldlex.l"
3241 { RTOKEN(ANDAND);}
3242 YY_BREAK
3243 case 27:
3244 YY_RULE_SETUP
3245 -#line 224 "ldlex.l"
3246 +#line 222 "ldlex.l"
3247 { RTOKEN('>');}
3248 YY_BREAK
3249 case 28:
3250 YY_RULE_SETUP
3251 -#line 225 "ldlex.l"
3252 +#line 223 "ldlex.l"
3253 { RTOKEN(',');}
3254 YY_BREAK
3255 case 29:
3256 YY_RULE_SETUP
3257 -#line 226 "ldlex.l"
3258 +#line 224 "ldlex.l"
3259 { RTOKEN('&');}
3260 YY_BREAK
3261 case 30:
3262 YY_RULE_SETUP
3263 -#line 227 "ldlex.l"
3264 +#line 225 "ldlex.l"
3265 { RTOKEN('|');}
3266 YY_BREAK
3267 case 31:
3268 YY_RULE_SETUP
3269 -#line 228 "ldlex.l"
3270 +#line 226 "ldlex.l"
3271 { RTOKEN('~');}
3272 YY_BREAK
3273 case 32:
3274 YY_RULE_SETUP
3275 -#line 229 "ldlex.l"
3276 +#line 227 "ldlex.l"
3277 { RTOKEN('!');}
3278 YY_BREAK
3279 case 33:
3280 YY_RULE_SETUP
3281 -#line 230 "ldlex.l"
3282 +#line 228 "ldlex.l"
3283 { RTOKEN('?');}
3284 YY_BREAK
3285 case 34:
3286 YY_RULE_SETUP
3287 -#line 231 "ldlex.l"
3288 +#line 229 "ldlex.l"
3289 { RTOKEN('*');}
3290 YY_BREAK
3291 case 35:
3292 YY_RULE_SETUP
3293 -#line 232 "ldlex.l"
3294 +#line 230 "ldlex.l"
3295 { RTOKEN('+');}
3296 YY_BREAK
3297 case 36:
3298 YY_RULE_SETUP
3299 -#line 233 "ldlex.l"
3300 +#line 231 "ldlex.l"
3301 { RTOKEN('-');}
3302 YY_BREAK
3303 case 37:
3304 YY_RULE_SETUP
3305 -#line 234 "ldlex.l"
3306 +#line 232 "ldlex.l"
3307 { RTOKEN('/');}
3308 YY_BREAK
3309 case 38:
3310 YY_RULE_SETUP
3311 -#line 235 "ldlex.l"
3312 +#line 233 "ldlex.l"
3313 { RTOKEN('%');}
3314 YY_BREAK
3315 case 39:
3316 YY_RULE_SETUP
3317 -#line 236 "ldlex.l"
3318 +#line 234 "ldlex.l"
3319 { RTOKEN('<');}
3320 YY_BREAK
3321 case 40:
3322 YY_RULE_SETUP
3323 -#line 237 "ldlex.l"
3324 +#line 235 "ldlex.l"
3325 { RTOKEN('=');}
3326 YY_BREAK
3327 case 41:
3328 YY_RULE_SETUP
3329 -#line 238 "ldlex.l"
3330 +#line 236 "ldlex.l"
3331 { RTOKEN('}') ; }
3332 YY_BREAK
3333 case 42:
3334 YY_RULE_SETUP
3335 -#line 239 "ldlex.l"
3336 +#line 237 "ldlex.l"
3337 { RTOKEN('{'); }
3338 YY_BREAK
3339 case 43:
3340 YY_RULE_SETUP
3341 -#line 240 "ldlex.l"
3342 +#line 238 "ldlex.l"
3343 { RTOKEN(')');}
3344 YY_BREAK
3345 case 44:
3346 YY_RULE_SETUP
3347 -#line 241 "ldlex.l"
3348 +#line 239 "ldlex.l"
3349 { RTOKEN('(');}
3350 YY_BREAK
3351 case 45:
3352 YY_RULE_SETUP
3353 -#line 242 "ldlex.l"
3354 +#line 240 "ldlex.l"
3355 { RTOKEN(':'); }
3356 YY_BREAK
3357 case 46:
3358 YY_RULE_SETUP
3359 -#line 243 "ldlex.l"
3360 +#line 241 "ldlex.l"
3361 { RTOKEN(';');}
3362 YY_BREAK
3363 case 47:
3364 YY_RULE_SETUP
3365 -#line 244 "ldlex.l"
3366 +#line 242 "ldlex.l"
3367 { RTOKEN(MEMORY);}
3368 YY_BREAK
3369 case 48:
3370 YY_RULE_SETUP
3371 -#line 245 "ldlex.l"
3372 +#line 243 "ldlex.l"
3373 { RTOKEN(REGION_ALIAS);}
3374 YY_BREAK
3375 case 49:
3376 YY_RULE_SETUP
3377 -#line 246 "ldlex.l"
3378 +#line 244 "ldlex.l"
3379 { RTOKEN(LD_FEATURE);}
3380 YY_BREAK
3381 case 50:
3382 YY_RULE_SETUP
3383 -#line 247 "ldlex.l"
3384 +#line 245 "ldlex.l"
3385 { RTOKEN(ORIGIN);}
3386 YY_BREAK
3387 case 51:
3388 YY_RULE_SETUP
3389 -#line 248 "ldlex.l"
3390 +#line 246 "ldlex.l"
3391 { RTOKEN(VERSIONK);}
3392 YY_BREAK
3393 case 52:
3394 YY_RULE_SETUP
3395 -#line 249 "ldlex.l"
3396 +#line 247 "ldlex.l"
3397 { RTOKEN(BLOCK);}
3398 YY_BREAK
3399 case 53:
3400 YY_RULE_SETUP
3401 -#line 250 "ldlex.l"
3402 +#line 248 "ldlex.l"
3403 { RTOKEN(BIND);}
3404 YY_BREAK
3405 case 54:
3406 YY_RULE_SETUP
3407 -#line 251 "ldlex.l"
3408 +#line 249 "ldlex.l"
3409 { RTOKEN(LENGTH);}
3410 YY_BREAK
3411 case 55:
3412 YY_RULE_SETUP
3413 -#line 252 "ldlex.l"
3414 +#line 250 "ldlex.l"
3415 { RTOKEN(ALIGN_K);}
3416 YY_BREAK
3417 case 56:
3418 YY_RULE_SETUP
3419 -#line 253 "ldlex.l"
3420 +#line 251 "ldlex.l"
3421 { RTOKEN(DATA_SEGMENT_ALIGN);}
3422 YY_BREAK
3423 case 57:
3424 YY_RULE_SETUP
3425 -#line 254 "ldlex.l"
3426 +#line 252 "ldlex.l"
3427 { RTOKEN(DATA_SEGMENT_RELRO_END);}
3428 YY_BREAK
3429 case 58:
3430 YY_RULE_SETUP
3431 -#line 255 "ldlex.l"
3432 +#line 253 "ldlex.l"
3433 { RTOKEN(DATA_SEGMENT_END);}
3434 YY_BREAK
3435 case 59:
3436 YY_RULE_SETUP
3437 -#line 256 "ldlex.l"
3438 +#line 254 "ldlex.l"
3439 { RTOKEN(ADDR);}
3440 YY_BREAK
3441 case 60:
3442 YY_RULE_SETUP
3443 -#line 257 "ldlex.l"
3444 +#line 255 "ldlex.l"
3445 { RTOKEN(LOADADDR);}
3446 YY_BREAK
3447 case 61:
3448 YY_RULE_SETUP
3449 -#line 258 "ldlex.l"
3450 +#line 256 "ldlex.l"
3451 { RTOKEN(ALIGNOF); }
3452 YY_BREAK
3453 case 62:
3454 YY_RULE_SETUP
3455 -#line 259 "ldlex.l"
3456 +#line 257 "ldlex.l"
3457 { RTOKEN(MAX_K); }
3458 YY_BREAK
3459 case 63:
3460 YY_RULE_SETUP
3461 -#line 260 "ldlex.l"
3462 +#line 258 "ldlex.l"
3463 { RTOKEN(MIN_K); }
3464 YY_BREAK
3465 case 64:
3466 YY_RULE_SETUP
3467 -#line 261 "ldlex.l"
3468 +#line 259 "ldlex.l"
3469 { RTOKEN(ASSERT_K); }
3470 YY_BREAK
3471 case 65:
3472 YY_RULE_SETUP
3473 -#line 262 "ldlex.l"
3474 +#line 260 "ldlex.l"
3475 { RTOKEN(ENTRY);}
3476 YY_BREAK
3477 case 66:
3478 YY_RULE_SETUP
3479 -#line 263 "ldlex.l"
3480 +#line 261 "ldlex.l"
3481 { RTOKEN(EXTERN);}
3482 YY_BREAK
3483 case 67:
3484 YY_RULE_SETUP
3485 -#line 264 "ldlex.l"
3486 +#line 262 "ldlex.l"
3487 { RTOKEN(NEXT);}
3488 YY_BREAK
3489 case 68:
3490 YY_RULE_SETUP
3491 -#line 265 "ldlex.l"
3492 +#line 263 "ldlex.l"
3493 { RTOKEN(SIZEOF_HEADERS);}
3494 YY_BREAK
3495 case 69:
3496 YY_RULE_SETUP
3497 -#line 266 "ldlex.l"
3498 +#line 264 "ldlex.l"
3499 { RTOKEN(SIZEOF_HEADERS);}
3500 YY_BREAK
3501 case 70:
3502 YY_RULE_SETUP
3503 -#line 267 "ldlex.l"
3504 +#line 265 "ldlex.l"
3505 { RTOKEN(SEGMENT_START);}
3506 YY_BREAK
3507 case 71:
3508 YY_RULE_SETUP
3509 -#line 268 "ldlex.l"
3510 +#line 266 "ldlex.l"
3511 { RTOKEN(MAP);}
3512 YY_BREAK
3513 case 72:
3514 YY_RULE_SETUP
3515 -#line 269 "ldlex.l"
3516 +#line 267 "ldlex.l"
3517 { RTOKEN(SIZEOF);}
3518 YY_BREAK
3519 case 73:
3520 YY_RULE_SETUP
3521 -#line 270 "ldlex.l"
3522 +#line 268 "ldlex.l"
3523 { RTOKEN(TARGET_K);}
3524 YY_BREAK
3525 case 74:
3526 YY_RULE_SETUP
3527 -#line 271 "ldlex.l"
3528 +#line 269 "ldlex.l"
3529 { RTOKEN(SEARCH_DIR);}
3530 YY_BREAK
3531 case 75:
3532 YY_RULE_SETUP
3533 -#line 272 "ldlex.l"
3534 +#line 270 "ldlex.l"
3535 { RTOKEN(OUTPUT);}
3536 YY_BREAK
3537 case 76:
3538 YY_RULE_SETUP
3539 -#line 273 "ldlex.l"
3540 +#line 271 "ldlex.l"
3541 { RTOKEN(INPUT);}
3542 YY_BREAK
3543 case 77:
3544 YY_RULE_SETUP
3545 -#line 274 "ldlex.l"
3546 +#line 272 "ldlex.l"
3547 { RTOKEN(GROUP);}
3548 YY_BREAK
3549 case 78:
3550 YY_RULE_SETUP
3551 -#line 275 "ldlex.l"
3552 +#line 273 "ldlex.l"
3553 { RTOKEN(AS_NEEDED);}
3554 YY_BREAK
3555 case 79:
3556 YY_RULE_SETUP
3557 -#line 276 "ldlex.l"
3558 +#line 274 "ldlex.l"
3559 { RTOKEN(DEFINED);}
3560 YY_BREAK
3561 case 80:
3562 YY_RULE_SETUP
3563 -#line 277 "ldlex.l"
3564 +#line 275 "ldlex.l"
3565 { RTOKEN(CREATE_OBJECT_SYMBOLS);}
3566 YY_BREAK
3567 case 81:
3568 YY_RULE_SETUP
3569 -#line 278 "ldlex.l"
3570 +#line 276 "ldlex.l"
3571 { RTOKEN( CONSTRUCTORS);}
3572 YY_BREAK
3573 case 82:
3574 YY_RULE_SETUP
3575 -#line 279 "ldlex.l"
3576 +#line 277 "ldlex.l"
3577 { RTOKEN(FORCE_COMMON_ALLOCATION);}
3578 YY_BREAK
3579 case 83:
3580 YY_RULE_SETUP
3581 -#line 280 "ldlex.l"
3582 +#line 278 "ldlex.l"
3583 { RTOKEN(INHIBIT_COMMON_ALLOCATION);}
3584 YY_BREAK
3585 case 84:
3586 YY_RULE_SETUP
3587 -#line 281 "ldlex.l"
3588 +#line 279 "ldlex.l"
3589 { RTOKEN(SECTIONS);}
3590 YY_BREAK
3591 case 85:
3592 YY_RULE_SETUP
3593 -#line 282 "ldlex.l"
3594 +#line 280 "ldlex.l"
3595 { RTOKEN(INSERT_K);}
3596 YY_BREAK
3597 case 86:
3598 YY_RULE_SETUP
3599 -#line 283 "ldlex.l"
3600 +#line 281 "ldlex.l"
3601 { RTOKEN(AFTER);}
3602 YY_BREAK
3603 case 87:
3604 YY_RULE_SETUP
3605 -#line 284 "ldlex.l"
3606 +#line 282 "ldlex.l"
3607 { RTOKEN(BEFORE);}
3608 YY_BREAK
3609 case 88:
3610 YY_RULE_SETUP
3611 -#line 285 "ldlex.l"
3612 +#line 283 "ldlex.l"
3613 { RTOKEN(FILL);}
3614 YY_BREAK
3615 case 89:
3616 YY_RULE_SETUP
3617 -#line 286 "ldlex.l"
3618 +#line 284 "ldlex.l"
3619 { RTOKEN(STARTUP);}
3620 YY_BREAK
3621 case 90:
3622 YY_RULE_SETUP
3623 -#line 287 "ldlex.l"
3624 +#line 285 "ldlex.l"
3625 { RTOKEN(OUTPUT_FORMAT);}
3626 YY_BREAK
3627 case 91:
3628 YY_RULE_SETUP
3629 -#line 288 "ldlex.l"
3630 +#line 286 "ldlex.l"
3631 { RTOKEN( OUTPUT_ARCH);}
3632 YY_BREAK
3633 case 92:
3634 YY_RULE_SETUP
3635 -#line 289 "ldlex.l"
3636 +#line 287 "ldlex.l"
3637 { RTOKEN(HLL);}
3638 YY_BREAK
3639 case 93:
3640 YY_RULE_SETUP
3641 -#line 290 "ldlex.l"
3642 +#line 288 "ldlex.l"
3643 { RTOKEN(SYSLIB);}
3644 YY_BREAK
3645 case 94:
3646 YY_RULE_SETUP
3647 -#line 291 "ldlex.l"
3648 +#line 289 "ldlex.l"
3649 { RTOKEN(FLOAT);}
3650 YY_BREAK
3651 case 95:
3652 YY_RULE_SETUP
3653 -#line 292 "ldlex.l"
3654 +#line 290 "ldlex.l"
3655 { RTOKEN( QUAD);}
3656 YY_BREAK
3657 case 96:
3658 YY_RULE_SETUP
3659 -#line 293 "ldlex.l"
3660 +#line 291 "ldlex.l"
3661 { RTOKEN( SQUAD);}
3662 YY_BREAK
3663 case 97:
3664 YY_RULE_SETUP
3665 -#line 294 "ldlex.l"
3666 +#line 292 "ldlex.l"
3667 { RTOKEN( LONG);}
3668 YY_BREAK
3669 case 98:
3670 YY_RULE_SETUP
3671 -#line 295 "ldlex.l"
3672 +#line 293 "ldlex.l"
3673 { RTOKEN( SHORT);}
3674 YY_BREAK
3675 case 99:
3676 YY_RULE_SETUP
3677 -#line 296 "ldlex.l"
3678 +#line 294 "ldlex.l"
3679 { RTOKEN( BYTE);}
3680 YY_BREAK
3681 case 100:
3682 YY_RULE_SETUP
3683 -#line 297 "ldlex.l"
3684 +#line 295 "ldlex.l"
3685 { RTOKEN(NOFLOAT);}
3686 YY_BREAK
3687 case 101:
3688 YY_RULE_SETUP
3689 -#line 298 "ldlex.l"
3690 +#line 296 "ldlex.l"
3691 { RTOKEN(NOCROSSREFS);}
3692 YY_BREAK
3693 case 102:
3694 YY_RULE_SETUP
3695 -#line 299 "ldlex.l"
3696 +#line 297 "ldlex.l"
3697 { RTOKEN(OVERLAY); }
3698 YY_BREAK
3699 case 103:
3700 YY_RULE_SETUP
3701 -#line 300 "ldlex.l"
3702 +#line 298 "ldlex.l"
3703 { RTOKEN(SORT_BY_NAME); }
3704 YY_BREAK
3705 case 104:
3706 YY_RULE_SETUP
3707 -#line 301 "ldlex.l"
3708 +#line 299 "ldlex.l"
3709 { RTOKEN(SORT_BY_ALIGNMENT); }
3710 YY_BREAK
3711 case 105:
3712 YY_RULE_SETUP
3713 -#line 302 "ldlex.l"
3714 +#line 300 "ldlex.l"
3715 { RTOKEN(SORT_BY_NAME); }
3716 YY_BREAK
3717 case 106:
3718 YY_RULE_SETUP
3719 -#line 303 "ldlex.l"
3720 +#line 301 "ldlex.l"
3721 { RTOKEN(NOLOAD);}
3722 YY_BREAK
3723 case 107:
3724 YY_RULE_SETUP
3725 -#line 304 "ldlex.l"
3726 +#line 302 "ldlex.l"
3727 { RTOKEN(DSECT);}
3728 YY_BREAK
3729 case 108:
3730 YY_RULE_SETUP
3731 -#line 305 "ldlex.l"
3732 +#line 303 "ldlex.l"
3733 { RTOKEN(COPY);}
3734 YY_BREAK
3735 case 109:
3736 YY_RULE_SETUP
3737 -#line 306 "ldlex.l"
3738 +#line 304 "ldlex.l"
3739 { RTOKEN(INFO);}
3740 YY_BREAK
3741 case 110:
3742 YY_RULE_SETUP
3743 -#line 307 "ldlex.l"
3744 +#line 305 "ldlex.l"
3745 { RTOKEN(OVERLAY);}
3746 YY_BREAK
3747 case 111:
3748 YY_RULE_SETUP
3749 -#line 308 "ldlex.l"
3750 +#line 306 "ldlex.l"
3751 { RTOKEN(ONLY_IF_RO); }
3752 YY_BREAK
3753 case 112:
3754 YY_RULE_SETUP
3755 -#line 309 "ldlex.l"
3756 +#line 307 "ldlex.l"
3757 { RTOKEN(ONLY_IF_RW); }
3758 YY_BREAK
3759 case 113:
3760 YY_RULE_SETUP
3761 -#line 310 "ldlex.l"
3762 +#line 308 "ldlex.l"
3763 { RTOKEN(SPECIAL); }
3764 YY_BREAK
3765 case 114:
3766 YY_RULE_SETUP
3767 -#line 311 "ldlex.l"
3768 +#line 309 "ldlex.l"
3769 { RTOKEN(ORIGIN);}
3770 YY_BREAK
3771 case 115:
3772 YY_RULE_SETUP
3773 -#line 312 "ldlex.l"
3774 +#line 310 "ldlex.l"
3775 { RTOKEN(ORIGIN);}
3776 YY_BREAK
3777 case 116:
3778 YY_RULE_SETUP
3779 -#line 313 "ldlex.l"
3780 +#line 311 "ldlex.l"
3781 { RTOKEN( LENGTH);}
3782 YY_BREAK
3783 case 117:
3784 YY_RULE_SETUP
3785 -#line 314 "ldlex.l"
3786 +#line 312 "ldlex.l"
3787 { RTOKEN( LENGTH);}
3788 YY_BREAK
3789 case 118:
3790 YY_RULE_SETUP
3791 -#line 315 "ldlex.l"
3792 +#line 313 "ldlex.l"
3793 { RTOKEN(INCLUDE);}
3794 YY_BREAK
3795 case 119:
3796 YY_RULE_SETUP
3797 -#line 316 "ldlex.l"
3798 +#line 314 "ldlex.l"
3799 { RTOKEN (PHDRS); }
3800 YY_BREAK
3801 case 120:
3802 YY_RULE_SETUP
3803 -#line 317 "ldlex.l"
3804 +#line 315 "ldlex.l"
3805 { RTOKEN(AT);}
3806 YY_BREAK
3807 case 121:
3808 YY_RULE_SETUP
3809 -#line 318 "ldlex.l"
3810 +#line 316 "ldlex.l"
3811 { RTOKEN(SUBALIGN);}
3812 YY_BREAK
3813 case 122:
3814 YY_RULE_SETUP
3815 -#line 319 "ldlex.l"
3816 +#line 317 "ldlex.l"
3817 { RTOKEN(PROVIDE); }
3818 YY_BREAK
3819 case 123:
3820 YY_RULE_SETUP
3821 -#line 320 "ldlex.l"
3822 +#line 318 "ldlex.l"
3823 { RTOKEN(PROVIDE_HIDDEN); }
3824 YY_BREAK
3825 case 124:
3826 YY_RULE_SETUP
3827 -#line 321 "ldlex.l"
3828 +#line 319 "ldlex.l"
3829 { RTOKEN(KEEP); }
3830 YY_BREAK
3831 case 125:
3832 YY_RULE_SETUP
3833 -#line 322 "ldlex.l"
3834 +#line 320 "ldlex.l"
3835 { RTOKEN(EXCLUDE_FILE); }
3836 YY_BREAK
3837 case 126:
3838 YY_RULE_SETUP
3839 -#line 323 "ldlex.l"
3840 +#line 321 "ldlex.l"
3841 { RTOKEN(CONSTANT);}
3842 YY_BREAK
3843 case 127:
3844 /* rule 127 can match eol */
3845 YY_RULE_SETUP
3846 -#line 324 "ldlex.l"
3847 +#line 322 "ldlex.l"
3848 { ++ lineno; }
3849 YY_BREAK
3850 case 128:
3851 /* rule 128 can match eol */
3852 YY_RULE_SETUP
3853 -#line 325 "ldlex.l"
3854 +#line 323 "ldlex.l"
3855 { ++ lineno; RTOKEN(NEWLINE); }
3856 YY_BREAK
3857 case 129:
3858 YY_RULE_SETUP
3859 -#line 326 "ldlex.l"
3860 +#line 324 "ldlex.l"
3861 { /* Mri comment line */ }
3862 YY_BREAK
3863 case 130:
3864 YY_RULE_SETUP
3865 -#line 327 "ldlex.l"
3866 +#line 325 "ldlex.l"
3867 { /* Mri comment line */ }
3868 YY_BREAK
3869 case 131:
3870 YY_RULE_SETUP
3871 -#line 328 "ldlex.l"
3872 +#line 326 "ldlex.l"
3873 { RTOKEN(ENDWORD); }
3874 YY_BREAK
3875 case 132:
3876 YY_RULE_SETUP
3877 -#line 329 "ldlex.l"
3878 +#line 327 "ldlex.l"
3879 { RTOKEN(ALIGNMOD);}
3880 YY_BREAK
3881 case 133:
3882 YY_RULE_SETUP
3883 -#line 330 "ldlex.l"
3884 +#line 328 "ldlex.l"
3885 { RTOKEN(ALIGN_K);}
3886 YY_BREAK
3887 case 134:
3888 YY_RULE_SETUP
3889 -#line 331 "ldlex.l"
3890 +#line 329 "ldlex.l"
3891 { RTOKEN(CHIP); }
3892 YY_BREAK
3893 case 135:
3894 YY_RULE_SETUP
3895 -#line 332 "ldlex.l"
3896 +#line 330 "ldlex.l"
3897 { RTOKEN(BASE); }
3898 YY_BREAK
3899 case 136:
3900 YY_RULE_SETUP
3901 -#line 333 "ldlex.l"
3902 +#line 331 "ldlex.l"
3903 { RTOKEN(ALIAS); }
3904 YY_BREAK
3905 case 137:
3906 YY_RULE_SETUP
3907 -#line 334 "ldlex.l"
3908 +#line 332 "ldlex.l"
3909 { RTOKEN(TRUNCATE); }
3910 YY_BREAK
3911 case 138:
3912 YY_RULE_SETUP
3913 -#line 335 "ldlex.l"
3914 +#line 333 "ldlex.l"
3915 { RTOKEN(LOAD); }
3916 YY_BREAK
3917 case 139:
3918 YY_RULE_SETUP
3919 -#line 336 "ldlex.l"
3920 +#line 334 "ldlex.l"
3921 { RTOKEN(PUBLIC); }
3922 YY_BREAK
3923 case 140:
3924 YY_RULE_SETUP
3925 -#line 337 "ldlex.l"
3926 +#line 335 "ldlex.l"
3927 { RTOKEN(ORDER); }
3928 YY_BREAK
3929 case 141:
3930 YY_RULE_SETUP
3931 -#line 338 "ldlex.l"
3932 +#line 336 "ldlex.l"
3933 { RTOKEN(NAMEWORD); }
3934 YY_BREAK
3935 case 142:
3936 YY_RULE_SETUP
3937 -#line 339 "ldlex.l"
3938 +#line 337 "ldlex.l"
3939 { RTOKEN(FORMAT); }
3940 YY_BREAK
3941 case 143:
3942 YY_RULE_SETUP
3943 -#line 340 "ldlex.l"
3944 +#line 338 "ldlex.l"
3945 { RTOKEN(CASE); }
3946 YY_BREAK
3947 case 144:
3948 YY_RULE_SETUP
3949 -#line 341 "ldlex.l"
3950 +#line 339 "ldlex.l"
3951 { RTOKEN(START); }
3952 YY_BREAK
3953 case 145:
3954 YY_RULE_SETUP
3955 -#line 342 "ldlex.l"
3956 +#line 340 "ldlex.l"
3957 { RTOKEN(LIST); /* LIST and ignore to end of line */ }
3958 YY_BREAK
3959 case 146:
3960 YY_RULE_SETUP
3961 -#line 343 "ldlex.l"
3962 +#line 341 "ldlex.l"
3963 { RTOKEN(SECT); }
3964 YY_BREAK
3965 case 147:
3966 YY_RULE_SETUP
3967 -#line 344 "ldlex.l"
3968 +#line 342 "ldlex.l"
3969 { RTOKEN(ABSOLUTE); }
3970 YY_BREAK
3971 case 148:
3972 YY_RULE_SETUP
3973 -#line 345 "ldlex.l"
3974 +#line 343 "ldlex.l"
3975 { RTOKEN(ENDWORD); }
3976 YY_BREAK
3977 case 149:
3978 YY_RULE_SETUP
3979 -#line 346 "ldlex.l"
3980 +#line 344 "ldlex.l"
3981 { RTOKEN(ALIGNMOD);}
3982 YY_BREAK
3983 case 150:
3984 YY_RULE_SETUP
3985 -#line 347 "ldlex.l"
3986 +#line 345 "ldlex.l"
3987 { RTOKEN(ALIGN_K);}
3988 YY_BREAK
3989 case 151:
3990 YY_RULE_SETUP
3991 -#line 348 "ldlex.l"
3992 +#line 346 "ldlex.l"
3993 { RTOKEN(CHIP); }
3994 YY_BREAK
3995 case 152:
3996 YY_RULE_SETUP
3997 -#line 349 "ldlex.l"
3998 +#line 347 "ldlex.l"
3999 { RTOKEN(BASE); }
4000 YY_BREAK
4001 case 153:
4002 YY_RULE_SETUP
4003 -#line 350 "ldlex.l"
4004 +#line 348 "ldlex.l"
4005 { RTOKEN(ALIAS); }
4006 YY_BREAK
4007 case 154:
4008 YY_RULE_SETUP
4009 -#line 351 "ldlex.l"
4010 +#line 349 "ldlex.l"
4011 { RTOKEN(TRUNCATE); }
4012 YY_BREAK
4013 case 155:
4014 YY_RULE_SETUP
4015 -#line 352 "ldlex.l"
4016 +#line 350 "ldlex.l"
4017 { RTOKEN(LOAD); }
4018 YY_BREAK
4019 case 156:
4020 YY_RULE_SETUP
4021 -#line 353 "ldlex.l"
4022 +#line 351 "ldlex.l"
4023 { RTOKEN(PUBLIC); }
4024 YY_BREAK
4025 case 157:
4026 YY_RULE_SETUP
4027 -#line 354 "ldlex.l"
4028 +#line 352 "ldlex.l"
4029 { RTOKEN(ORDER); }
4030 YY_BREAK
4031 case 158:
4032 YY_RULE_SETUP
4033 -#line 355 "ldlex.l"
4034 +#line 353 "ldlex.l"
4035 { RTOKEN(NAMEWORD); }
4036 YY_BREAK
4037 case 159:
4038 YY_RULE_SETUP
4039 -#line 356 "ldlex.l"
4040 +#line 354 "ldlex.l"
4041 { RTOKEN(FORMAT); }
4042 YY_BREAK
4043 case 160:
4044 YY_RULE_SETUP
4045 -#line 357 "ldlex.l"
4046 +#line 355 "ldlex.l"
4047 { RTOKEN(CASE); }
4048 YY_BREAK
4049 case 161:
4050 YY_RULE_SETUP
4051 -#line 358 "ldlex.l"
4052 +#line 356 "ldlex.l"
4053 { RTOKEN(EXTERN); }
4054 YY_BREAK
4055 case 162:
4056 YY_RULE_SETUP
4057 -#line 359 "ldlex.l"
4058 +#line 357 "ldlex.l"
4059 { RTOKEN(START); }
4060 YY_BREAK
4061 case 163:
4062 YY_RULE_SETUP
4063 -#line 360 "ldlex.l"
4064 +#line 358 "ldlex.l"
4065 { RTOKEN(LIST); /* LIST and ignore to end of line */ }
4066 YY_BREAK
4067 case 164:
4068 YY_RULE_SETUP
4069 -#line 361 "ldlex.l"
4070 +#line 359 "ldlex.l"
4071 { RTOKEN(SECT); }
4072 YY_BREAK
4073 case 165:
4074 YY_RULE_SETUP
4075 -#line 362 "ldlex.l"
4076 +#line 360 "ldlex.l"
4077 { RTOKEN(ABSOLUTE); }
4078 YY_BREAK
4079 case 166:
4080 YY_RULE_SETUP
4081 -#line 364 "ldlex.l"
4082 +#line 362 "ldlex.l"
4084 /* Filename without commas, needed to parse mri stuff */
4085 yylval.name = xstrdup (yytext);
4086 @@ -2844,7 +2852,7 @@
4087 YY_BREAK
4088 case 167:
4089 YY_RULE_SETUP
4090 -#line 371 "ldlex.l"
4091 +#line 369 "ldlex.l"
4093 yylval.name = xstrdup (yytext);
4094 return NAME;
4095 @@ -2852,7 +2860,7 @@
4096 YY_BREAK
4097 case 168:
4098 YY_RULE_SETUP
4099 -#line 375 "ldlex.l"
4100 +#line 373 "ldlex.l"
4102 yylval.name = xstrdup (yytext + 2);
4103 return LNAME;
4104 @@ -2860,7 +2868,7 @@
4105 YY_BREAK
4106 case 169:
4107 YY_RULE_SETUP
4108 -#line 379 "ldlex.l"
4109 +#line 377 "ldlex.l"
4111 yylval.name = xstrdup (yytext);
4112 return NAME;
4113 @@ -2868,7 +2876,7 @@
4114 YY_BREAK
4115 case 170:
4116 YY_RULE_SETUP
4117 -#line 383 "ldlex.l"
4118 +#line 381 "ldlex.l"
4120 yylval.name = xstrdup (yytext + 2);
4121 return LNAME;
4122 @@ -2876,7 +2884,7 @@
4123 YY_BREAK
4124 case 171:
4125 YY_RULE_SETUP
4126 -#line 387 "ldlex.l"
4127 +#line 385 "ldlex.l"
4129 /* Annoyingly, this pattern can match comments, and we have
4130 longest match issues to consider. So if the first two
4131 @@ -2897,7 +2905,7 @@
4132 case 172:
4133 /* rule 172 can match eol */
4134 YY_RULE_SETUP
4135 -#line 404 "ldlex.l"
4136 +#line 402 "ldlex.l"
4138 /* No matter the state, quotes
4139 give what's inside */
4140 @@ -2909,54 +2917,54 @@
4141 case 173:
4142 /* rule 173 can match eol */
4143 YY_RULE_SETUP
4144 -#line 411 "ldlex.l"
4145 +#line 409 "ldlex.l"
4146 { lineno++;}
4147 YY_BREAK
4148 case 174:
4149 YY_RULE_SETUP
4150 -#line 412 "ldlex.l"
4151 +#line 410 "ldlex.l"
4153 YY_BREAK
4154 case 175:
4155 YY_RULE_SETUP
4156 -#line 414 "ldlex.l"
4157 +#line 412 "ldlex.l"
4158 { return *yytext; }
4159 YY_BREAK
4160 case 176:
4161 YY_RULE_SETUP
4162 -#line 416 "ldlex.l"
4163 +#line 414 "ldlex.l"
4164 { RTOKEN(GLOBAL); }
4165 YY_BREAK
4166 case 177:
4167 YY_RULE_SETUP
4168 -#line 418 "ldlex.l"
4169 +#line 416 "ldlex.l"
4170 { RTOKEN(LOCAL); }
4171 YY_BREAK
4172 case 178:
4173 YY_RULE_SETUP
4174 -#line 420 "ldlex.l"
4175 +#line 418 "ldlex.l"
4176 { RTOKEN(EXTERN); }
4177 YY_BREAK
4178 case 179:
4179 YY_RULE_SETUP
4180 -#line 422 "ldlex.l"
4181 +#line 420 "ldlex.l"
4182 { yylval.name = xstrdup (yytext);
4183 return VERS_IDENTIFIER; }
4184 YY_BREAK
4185 case 180:
4186 YY_RULE_SETUP
4187 -#line 425 "ldlex.l"
4188 +#line 423 "ldlex.l"
4189 { yylval.name = xstrdup (yytext);
4190 return VERS_TAG; }
4191 YY_BREAK
4192 case 181:
4193 YY_RULE_SETUP
4194 -#line 428 "ldlex.l"
4195 +#line 426 "ldlex.l"
4196 { BEGIN(VERS_SCRIPT); return *yytext; }
4197 YY_BREAK
4198 case 182:
4199 YY_RULE_SETUP
4200 -#line 430 "ldlex.l"
4201 +#line 428 "ldlex.l"
4202 { BEGIN(VERS_NODE);
4203 vers_node_nesting = 0;
4204 return *yytext;
4205 @@ -2964,17 +2972,17 @@
4206 YY_BREAK
4207 case 183:
4208 YY_RULE_SETUP
4209 -#line 434 "ldlex.l"
4210 +#line 432 "ldlex.l"
4211 { return *yytext; }
4212 YY_BREAK
4213 case 184:
4214 YY_RULE_SETUP
4215 -#line 435 "ldlex.l"
4216 +#line 433 "ldlex.l"
4217 { vers_node_nesting++; return *yytext; }
4218 YY_BREAK
4219 case 185:
4220 YY_RULE_SETUP
4221 -#line 436 "ldlex.l"
4222 +#line 434 "ldlex.l"
4223 { if (--vers_node_nesting < 0)
4224 BEGIN(VERS_SCRIPT);
4225 return *yytext;
4226 @@ -2983,17 +2991,17 @@
4227 case 186:
4228 /* rule 186 can match eol */
4229 YY_RULE_SETUP
4230 -#line 441 "ldlex.l"
4231 +#line 439 "ldlex.l"
4232 { lineno++; }
4233 YY_BREAK
4234 case 187:
4235 YY_RULE_SETUP
4236 -#line 443 "ldlex.l"
4237 +#line 441 "ldlex.l"
4238 { /* Eat up comments */ }
4239 YY_BREAK
4240 case 188:
4241 YY_RULE_SETUP
4242 -#line 445 "ldlex.l"
4243 +#line 443 "ldlex.l"
4244 { /* Eat up whitespace */ }
4245 YY_BREAK
4246 case YY_STATE_EOF(INITIAL):
4247 @@ -3005,7 +3013,7 @@
4248 case YY_STATE_EOF(VERS_START):
4249 case YY_STATE_EOF(VERS_SCRIPT):
4250 case YY_STATE_EOF(VERS_NODE):
4251 -#line 447 "ldlex.l"
4252 +#line 445 "ldlex.l"
4254 include_stack_ptr--;
4256 @@ -3026,20 +3034,20 @@
4257 YY_BREAK
4258 case 189:
4259 YY_RULE_SETUP
4260 -#line 465 "ldlex.l"
4261 +#line 463 "ldlex.l"
4262 lex_warn_invalid (" in script", yytext);
4263 YY_BREAK
4264 case 190:
4265 YY_RULE_SETUP
4266 -#line 466 "ldlex.l"
4267 +#line 464 "ldlex.l"
4268 lex_warn_invalid (" in expression", yytext);
4269 YY_BREAK
4270 case 191:
4271 YY_RULE_SETUP
4272 -#line 468 "ldlex.l"
4273 +#line 466 "ldlex.l"
4274 ECHO;
4275 YY_BREAK
4276 -#line 3043 "ldlex.c"
4277 +#line 3051 "ldlex.c"
4279 case YY_END_OF_BUFFER:
4281 @@ -3223,7 +3231,7 @@
4283 else
4285 - yy_size_t num_to_read =
4286 + int num_to_read =
4287 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
4289 while ( num_to_read <= 0 )
4290 @@ -3237,7 +3245,7 @@
4292 if ( b->yy_is_our_buffer )
4294 - yy_size_t new_size = b->yy_buf_size * 2;
4295 + int new_size = b->yy_buf_size * 2;
4297 if ( new_size <= 0 )
4298 b->yy_buf_size += b->yy_buf_size / 8;
4299 @@ -3268,7 +3276,7 @@
4301 /* Read in more data. */
4302 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
4303 - (yy_n_chars), num_to_read );
4304 + (yy_n_chars), (size_t) num_to_read );
4306 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
4308 @@ -3366,6 +3374,10 @@
4309 return yy_is_jam ? 0 : yy_current_state;
4312 +#ifndef YY_NO_UNPUT
4314 +#endif
4316 #ifndef YY_NO_INPUT
4317 #ifdef __cplusplus
4318 static int yyinput (void)
4319 @@ -3390,7 +3402,7 @@
4321 else
4322 { /* need more input */
4323 - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
4324 + int offset = (yy_c_buf_p) - (yytext_ptr);
4325 ++(yy_c_buf_p);
4327 switch ( yy_get_next_buffer( ) )
4328 @@ -3414,7 +3426,7 @@
4329 case EOB_ACT_END_OF_FILE:
4331 if ( yywrap( ) )
4332 - return 0;
4333 + return EOF;
4335 if ( ! (yy_did_buffer_switch_on_eof) )
4336 YY_NEW_FILE;
4337 @@ -3666,7 +3678,7 @@
4339 static void yyensure_buffer_stack (void)
4341 - yy_size_t num_to_alloc;
4342 + int num_to_alloc;
4344 if (!(yy_buffer_stack)) {
4346 @@ -3763,11 +3775,12 @@
4348 * @return the newly allocated buffer state object.
4350 -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
4351 +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
4353 YY_BUFFER_STATE b;
4354 char *buf;
4355 - yy_size_t n, i;
4356 + yy_size_t n;
4357 + int i;
4359 /* Get memory for full buffer, including space for trailing EOB's. */
4360 n = _yybytes_len + 2;
4361 @@ -3849,7 +3862,7 @@
4362 /** Get the length of the current token.
4365 -yy_size_t yyget_leng (void)
4366 +int yyget_leng (void)
4368 return yyleng;
4370 @@ -3864,29 +3877,29 @@
4373 /** Set the current line number.
4374 - * @param line_number
4375 + * @param _line_number
4378 -void yyset_lineno (int line_number )
4379 +void yyset_lineno (int _line_number )
4382 - yylineno = line_number;
4383 + yylineno = _line_number;
4386 /** Set the input stream. This does not discard the current
4387 * input buffer.
4388 - * @param in_str A readable stream.
4389 + * @param _in_str A readable stream.
4391 * @see yy_switch_to_buffer
4393 -void yyset_in (FILE * in_str )
4394 +void yyset_in (FILE * _in_str )
4396 - yyin = in_str ;
4397 + yyin = _in_str ;
4400 -void yyset_out (FILE * out_str )
4401 +void yyset_out (FILE * _out_str )
4403 - yyout = out_str ;
4404 + yyout = _out_str ;
4407 int yyget_debug (void)
4408 @@ -3894,9 +3907,9 @@
4409 return yy_flex_debug;
4412 -void yyset_debug (int bdebug )
4413 +void yyset_debug (int _bdebug )
4415 - yy_flex_debug = bdebug ;
4416 + yy_flex_debug = _bdebug ;
4419 static int yy_init_globals (void)
4420 @@ -3997,7 +4010,7 @@
4422 #define YYTABLES_NAME "yytables"
4424 -#line 468 "ldlex.l"
4425 +#line 466 "ldlex.l"
4429 diff -rNU3 dist/ld/ldlex.l dist.nbsd/ld/ldlex.l
4430 --- dist/ld/ldlex.l Wed Nov 7 11:43:28 2012
4431 +++ dist.nbsd/ld/ldlex.l Wed Nov 7 11:13:50 2012
4432 @@ -60,10 +60,6 @@
4433 #undef YY_INPUT
4434 #define YY_INPUT(buf,result,max_size) result = yy_input (buf, max_size)
4436 -#ifndef YY_NO_UNPUT
4437 -#define YY_NO_UNPUT
4438 -#endif
4440 #define MAX_INCLUDE_DEPTH 10
4441 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
4442 static const char *file_name_stack[MAX_INCLUDE_DEPTH];
4443 @@ -92,6 +88,8 @@
4444 int yywrap (void) { return 1; }
4445 #endif
4448 +%option nounput
4450 %a 4000
4451 %o 5000
4452 diff -rNU3 dist/ld/ldmain.c dist.nbsd/ld/ldmain.c
4453 --- dist/ld/ldmain.c Wed Nov 7 11:43:28 2012
4454 +++ dist.nbsd/ld/ldmain.c Wed Nov 7 11:13:50 2012
4455 @@ -694,6 +694,23 @@
4456 einfo (_("%P%F: bfd_hash_lookup failed: %E\n"));
4459 +void
4460 +add_ignoresym (const char *name)
4462 + if (link_info.ignore_hash == NULL)
4464 + link_info.ignore_hash = xmalloc (sizeof (struct bfd_hash_table));
4465 + if (! bfd_hash_table_init_n (link_info.ignore_hash,
4466 + bfd_hash_newfunc,
4467 + sizeof (struct bfd_hash_entry),
4468 + 61))
4469 + einfo (_("%P%F: bfd_hash_table_init failed: %E\n"));
4472 + if (bfd_hash_lookup (link_info.ignore_hash, name, TRUE, TRUE) == NULL)
4473 + einfo (_("%P%F: bfd_hash_lookup failed: %E\n"));
4476 /* Record a symbol to be wrapped, from the --wrap option. */
4478 void
4479 @@ -1291,24 +1308,25 @@
4481 #define MAX_ERRORS_IN_A_ROW 5
4483 + if (info->ignore_hash != NULL
4484 + && bfd_hash_lookup (info->ignore_hash, name, FALSE, FALSE) != NULL)
4485 + return TRUE;
4487 if (config.warn_once)
4489 - static struct bfd_hash_table *hash;
4491 /* Only warn once about a particular undefined symbol. */
4492 - if (hash == NULL)
4493 + if (info->ignore_hash == NULL)
4495 - hash = (struct bfd_hash_table *)
4496 - xmalloc (sizeof (struct bfd_hash_table));
4497 - if (!bfd_hash_table_init (hash, bfd_hash_newfunc,
4498 + info->ignore_hash = xmalloc (sizeof (struct bfd_hash_table));
4499 + if (!bfd_hash_table_init (info->ignore_hash, bfd_hash_newfunc,
4500 sizeof (struct bfd_hash_entry)))
4501 einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
4504 - if (bfd_hash_lookup (hash, name, FALSE, FALSE) != NULL)
4505 + if (bfd_hash_lookup (info->ignore_hash, name, FALSE, FALSE) != NULL)
4506 return TRUE;
4508 - if (bfd_hash_lookup (hash, name, TRUE, TRUE) == NULL)
4509 + if (bfd_hash_lookup (info->ignore_hash, name, TRUE, TRUE) == NULL)
4510 einfo (_("%F%P: bfd_hash_lookup failed: %E\n"));
4513 diff -rNU3 dist/ld/ldmain.h dist.nbsd/ld/ldmain.h
4514 --- dist/ld/ldmain.h Wed Nov 7 11:43:28 2012
4515 +++ dist.nbsd/ld/ldmain.h Wed Nov 7 11:13:51 2012
4516 @@ -44,6 +44,7 @@
4518 extern void add_ysym (const char *);
4519 extern void add_wrap (const char *);
4520 +extern void add_ignoresym (const char *);
4521 extern void add_keepsyms_file (const char *);
4523 #endif
4524 diff -rNU3 dist/ld/lexsup.c dist.nbsd/ld/lexsup.c
4525 --- dist/ld/lexsup.c Wed Nov 7 11:43:28 2012
4526 +++ dist.nbsd/ld/lexsup.c Wed Nov 7 11:13:50 2012
4527 @@ -175,6 +175,7 @@
4528 OPTION_PLUGIN_OPT,
4529 #endif /* ENABLE_PLUGINS */
4530 OPTION_DEFAULT_SCRIPT,
4531 + OPTION_IGNORE_UNRESOLVED_SYMBOL
4534 /* The long options. This structure is used for both the option
4535 @@ -512,7 +513,7 @@
4536 ONE_DASH },
4537 { {"shared", no_argument, NULL, OPTION_SHARED},
4538 '\0', NULL, N_("Create a shared library"), ONE_DASH },
4539 - { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD. */
4540 + { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD, NetBSD. */
4541 '\0', NULL, NULL, ONE_DASH },
4542 { {"pie", no_argument, NULL, OPTION_PIE},
4543 '\0', NULL, N_("Create a position independent executable"), ONE_DASH },
4544 @@ -608,8 +609,14 @@
4545 { {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
4546 '\0', NULL, N_("Include all objects from following archives"),
4547 TWO_DASHES },
4548 + { {"Bforcearchive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
4549 + '\0', NULL, NULL, TWO_DASHES }, /* NetBSD. */
4550 { {"wrap", required_argument, NULL, OPTION_WRAP},
4551 '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
4552 + { {"ignore-unresolved-symbol", required_argument, NULL,
4553 + OPTION_IGNORE_UNRESOLVED_SYMBOL},
4554 + '\0', N_("SYMBOL"),
4555 + N_("Unresolved SYMBOL will not cause an error or warning"), TWO_DASHES },
4558 #define OPTION_COUNT ARRAY_SIZE (ld_options)
4559 @@ -1452,6 +1459,9 @@
4560 break;
4561 case OPTION_WRAP:
4562 add_wrap (optarg);
4563 + break;
4564 + case OPTION_IGNORE_UNRESOLVED_SYMBOL:
4565 + add_ignoresym (optarg);
4566 break;
4567 case OPTION_DISCARD_NONE:
4568 link_info.discard = discard_none;
4569 diff -rNU3 dist/ld/scripttempl/elf.sc dist.nbsd/ld/scripttempl/elf.sc
4570 --- dist/ld/scripttempl/elf.sc Wed Nov 7 11:43:28 2012
4571 +++ dist.nbsd/ld/scripttempl/elf.sc Wed Nov 7 11:13:50 2012
4572 @@ -91,6 +91,8 @@
4574 # Each of these can also have corresponding .rel.* and .rela.* sections.
4576 +test -z "$TEXT_START_SYMBOLS" && TEXT_START_SYMBOLS="PROVIDE_HIDDEN (__eprol = .);"
4577 +test -z "$ENTRY" && ENTRY=_start
4578 test -z "$RODATA_NAME" && RODATA_NAME=rodata
4579 test -z "$SDATA_NAME" && SDATA_NAME=sdata
4580 test -z "$SBSS_NAME" && SBSS_NAME=sbss
4581 diff -rNU3 dist/ld/scripttempl/sh.sc dist.nbsd/ld/scripttempl/sh.sc
4582 --- dist/ld/scripttempl/sh.sc Wed Nov 7 11:43:28 2012
4583 +++ dist.nbsd/ld/scripttempl/sh.sc Wed Nov 7 11:13:50 2012
4584 @@ -6,17 +6,14 @@
4585 ___dtors = . ;
4586 *(.dtors)
4587 ___dtors_end = . ;
4588 - } > ram"
4589 + }"
4592 cat <<EOF
4593 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
4594 OUTPUT_ARCH(${ARCH})
4595 +${LIB_SEARCH_DIRS}
4597 -MEMORY
4599 - ram : o = 0x1000, l = 512k
4602 SECTIONS
4604 .text :
4605 @@ -24,9 +21,9 @@
4606 *(.text)
4607 *(.strings)
4608 ${RELOCATING+ _etext = . ; }
4609 - } ${RELOCATING+ > ram}
4611 ${CONSTRUCTING+${TORS}}
4612 - .data :
4613 + .data ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} :
4615 *(.data)
4616 ${RELOCATING+*(.gcc_exc*)}
4617 @@ -35,19 +32,19 @@
4618 ${RELOCATING+___EH_FRAME_END__ = . ;}
4619 ${RELOCATING+LONG(0);}
4620 ${RELOCATING+ _edata = . ; }
4621 - } ${RELOCATING+ > ram}
4622 - .bss :
4624 + .bss ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} :
4626 ${RELOCATING+ _bss_start = . ; }
4627 *(.bss)
4628 *(COMMON)
4629 ${RELOCATING+ _end = . ; }
4630 - } ${RELOCATING+ > ram}
4631 - .stack ${RELOCATING+ 0x30000 } :
4633 + .stack :
4635 ${RELOCATING+ _stack = . ; }
4636 *(.stack)
4637 - } ${RELOCATING+ > ram}
4639 .stab 0 ${RELOCATING+(NOLOAD)} :
4641 *(.stab)
4642 diff -rNU3 dist/libiberty/floatformat.c dist.nbsd/libiberty/floatformat.c
4643 --- dist/libiberty/floatformat.c Wed Nov 7 11:43:26 2012
4644 +++ dist.nbsd/libiberty/floatformat.c Wed Nov 7 11:13:54 2012
4645 @@ -489,7 +489,11 @@
4646 if (nan)
4647 dto = NAN;
4648 else
4649 +#ifdef __vax__
4650 + dto = HUGE_VAL;
4651 +#else
4652 dto = INFINITY;
4653 +#endif
4655 if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
4656 dto = -dto;
4657 diff -rNU3 dist/libiberty/strerror.c dist.nbsd/libiberty/strerror.c
4658 --- dist/libiberty/strerror.c Wed Nov 7 11:43:26 2012
4659 +++ dist.nbsd/libiberty/strerror.c Wed Nov 7 11:13:54 2012
4660 @@ -347,7 +347,7 @@
4661 ENTRY(EPROTOTYPE, "EPROTOTYPE", "Protocol wrong type for socket"),
4662 #endif
4663 #if defined (ENOPROTOOPT)
4664 - ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol not available"),
4665 + ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol option not available"),
4666 #endif
4667 #if defined (EPROTONOSUPPORT)
4668 ENTRY(EPROTONOSUPPORT, "EPROTONOSUPPORT", "Protocol not supported"),
4669 diff -rNU3 dist/opcodes/cgen.sh dist.nbsd/opcodes/cgen.sh
4670 --- dist/opcodes/cgen.sh Wed Nov 7 11:43:26 2012
4671 +++ dist.nbsd/opcodes/cgen.sh Wed Nov 7 11:13:50 2012
4672 @@ -61,6 +61,7 @@
4673 shift ; extrafiles=$9
4675 rootdir=${srcdir}/..
4676 +move_if_change="${CONFIG_SHELL:-/bin/sh} ${rootdir}/move-if-change"
4678 # $arch is $6, as passed on the command line.
4679 # $ARCH is the same argument but in all uppercase.
4680 diff -rNU3 dist/opcodes/configure dist.nbsd/opcodes/configure
4681 --- dist/opcodes/configure Wed Nov 7 11:43:26 2012
4682 +++ dist.nbsd/opcodes/configure Wed Nov 7 11:13:50 2012
4683 @@ -12473,6 +12473,14 @@
4684 # specified, as in sh3-elf, sh3b-linux-gnu, etc.
4685 # Include it just for ELF targets, since the SH5 bfd:s are ELF only.
4686 for t in $target $canon_targets; do
4687 + # For NetBSD we do NOT want SH5 support unless sh5 or sh64
4688 + # is specified
4689 + case $t in
4690 + sh5*-* | sh64*-*) # let the case below handle it
4691 + ;;
4692 + sh*-*-netbsd* | sh*l*-*-netbsd*)
4693 + continue ;;
4694 + esac
4695 case $t in
4696 all | sh5*-* | sh64*-* | sh-*-*elf* | shl*-*-*elf* | \
4697 sh-*-linux* | shl-*-linux*)
4698 diff -rNU3 dist/opcodes/configure.in dist.nbsd/opcodes/configure.in
4699 --- dist/opcodes/configure.in Wed Nov 7 11:43:26 2012
4700 +++ dist.nbsd/opcodes/configure.in Wed Nov 7 11:13:50 2012
4701 @@ -279,6 +279,14 @@
4702 # specified, as in sh3-elf, sh3b-linux-gnu, etc.
4703 # Include it just for ELF targets, since the SH5 bfd:s are ELF only.
4704 for t in $target $canon_targets; do
4705 + # For NetBSD we do NOT want SH5 support unless sh5 or sh64
4706 + # is specified
4707 + case $t in
4708 + sh5*-* | sh64*-*) # let the case below handle it
4709 + ;;
4710 + sh*-*-netbsd* | sh*l*-*-netbsd*)
4711 + continue ;;
4712 + esac
4713 case $t in
4714 all | sh5*-* | sh64*-* | sh-*-*elf* | shl*-*-*elf* | \
4715 sh-*-linux* | shl-*-linux*)
4716 diff -rNU3 dist/opcodes/mips-opc.c dist.nbsd/opcodes/mips-opc.c
4717 --- dist/opcodes/mips-opc.c Wed Nov 7 11:43:26 2012
4718 +++ dist.nbsd/opcodes/mips-opc.c Wed Nov 7 11:13:50 2012
4719 @@ -709,10 +709,12 @@
4720 {"floor.w.s", "D,S", 0x4600000f, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
4721 {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 },
4722 {"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 },
4723 +{"jr", "s", 0, (int) M_JR_S, INSN_MACRO, 0, I1 },
4724 {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 },
4725 /* jr.hb is officially MIPS{32,64}R2, but it works on R1 as jr with
4726 the same hazard barrier effect. */
4727 {"jr.hb", "s", 0x00000408, 0xfc1fffff, UBD|RD_s, 0, I32 },
4728 +{"j", "s", 0, (int) M_J_S, INSN_MACRO, 0, I1 },
4729 {"j", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, /* jr */
4730 /* SVR4 PIC code requires special handling for j, so it must be a
4731 macro. */
4732 @@ -721,7 +723,9 @@
4733 assembler, but will never match user input (because the line above
4734 will match first). */
4735 {"j", "a", 0x08000000, 0xfc000000, UBD, 0, I1 },
4736 +{"jalr", "s", 0, (int) M_JALR_S, INSN_MACRO, 0, I1 },
4737 {"jalr", "s", 0x0000f809, 0xfc1fffff, UBD|RD_s|WR_d, 0, I1 },
4738 +{"jalr", "d,s", 0, (int) M_JALR_DS, INSN_MACRO, 0, I1 },
4739 {"jalr", "d,s", 0x00000009, 0xfc1f07ff, UBD|RD_s|WR_d, 0, I1 },
4740 /* jalr.hb is officially MIPS{32,64}R2, but it works on R1 as jalr
4741 with the same hazard barrier effect. */