CVS commit: src/external/gpl3/binutils/dist/bfd

2021-04-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Apr 22 01:09:48 UTC 2021

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-ppc.c elf64-ppc.c

Log Message:
Fix regression where ld(1) is trapped into infinite loop when
linking binary whose text does not fit within R_PPC_REL24.

Reported upstream as Bug 27755:
https://sourceware.org/bugzilla/show_bug.cgi?id=27755

This problem was introduced to binutils-2-31-1 for our tree.
netbsd-9 is affected, while netbsd-8 is not.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/binutils/dist/bfd/elf32-ppc.c \
src/external/gpl3/binutils/dist/bfd/elf64-ppc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.15 src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.16
--- src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.15	Fri Apr  3 23:48:46 2020
+++ src/external/gpl3/binutils/dist/bfd/elf32-ppc.c	Thu Apr 22 01:09:48 2021
@@ -4235,7 +4235,7 @@ ppc_elf_inline_plt (struct bfd_link_info
 	  return FALSE;
 
 	relend = relstart + sec->reloc_count;
-	for (rel = relstart; rel < relend; )
+	for (rel = relstart; rel < relend; rel++)
 	  {
 		enum elf_ppc_reloc_type r_type;
 		unsigned long r_symndx;
Index: src/external/gpl3/binutils/dist/bfd/elf64-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.15 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.16
--- src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.15	Fri Apr  3 23:48:46 2020
+++ src/external/gpl3/binutils/dist/bfd/elf64-ppc.c	Thu Apr 22 01:09:48 2021
@@ -7507,7 +7507,7 @@ ppc64_elf_inline_plt (struct bfd_link_in
 	  return FALSE;
 
 	relend = relstart + sec->reloc_count;
-	for (rel = relstart; rel < relend; )
+	for (rel = relstart; rel < relend; rel++)
 	  {
 		enum elf_ppc64_reloc_type r_type;
 		unsigned long r_symndx;



CVS commit: src/external/gpl3/binutils/dist/bfd

2020-09-07 Thread Tom Spindler
Module Name:src
Committed By:   dogcow
Date:   Mon Sep  7 19:46:45 UTC 2020

Modified Files:
src/external/gpl3/binutils/dist/bfd: Makefile.am Makefile.in

Log Message:
Fix `build.sh tools -j1` compilation, where bfd.h wasn't generated early
enough.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/binutils/dist/bfd/Makefile.am
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/binutils/dist/bfd/Makefile.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/Makefile.am
diff -u src/external/gpl3/binutils/dist/bfd/Makefile.am:1.7 src/external/gpl3/binutils/dist/bfd/Makefile.am:1.8
--- src/external/gpl3/binutils/dist/bfd/Makefile.am:1.7	Fri Apr  3 23:48:45 2020
+++ src/external/gpl3/binutils/dist/bfd/Makefile.am	Mon Sep  7 19:46:45 2020
@@ -363,6 +363,7 @@ BFD32_BACKENDS = \
 	i386bsd.lo \
 	i386lynx.lo \
 	i386msdos.lo \
+	i386netbsd.lo \
 	mach-o.lo \
 	mach-o-i386.lo \
 	mach-o-arm.lo \
@@ -499,6 +500,7 @@ BFD32_BACKENDS_CFILES = \
 	i386bsd.c \
 	i386lynx.c \
 	i386msdos.c \
+	i386netbsd.c \
 	mach-o.c \
 	mach-o-i386.c \
 	mach-o-arm.c \

Index: src/external/gpl3/binutils/dist/bfd/Makefile.in
diff -u src/external/gpl3/binutils/dist/bfd/Makefile.in:1.8 src/external/gpl3/binutils/dist/bfd/Makefile.in:1.9
--- src/external/gpl3/binutils/dist/bfd/Makefile.in:1.8	Fri Apr  3 23:48:45 2020
+++ src/external/gpl3/binutils/dist/bfd/Makefile.in	Mon Sep  7 19:46:45 2020
@@ -792,6 +792,7 @@ BFD32_BACKENDS = \
 	i386bsd.lo \
 	i386lynx.lo \
 	i386msdos.lo \
+	i386netbsd.lo \
 	mach-o.lo \
 	mach-o-i386.lo \
 	mach-o-arm.lo \
@@ -930,6 +931,7 @@ BFD32_BACKENDS_CFILES = \
 	i386bsd.c \
 	i386lynx.c \
 	i386msdos.c \
+	i386netbsd.c \
 	mach-o.c \
 	mach-o-i386.c \
 	mach-o-arm.c \
@@ -1537,6 +1539,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386bsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386lynx.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386msdos.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386netbsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihex.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/irix-core.Plo@am__quote@



CVS commit: src/external/gpl3/binutils/dist/bfd

2020-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug  8 19:26:09 UTC 2020

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd configure configure.ac
targets.c
Added Files:
src/external/gpl3/binutils/dist/bfd: i386netbsd.c

Log Message:
Put back the a.out netbsd and bsd vector. They are useful for debugging
old a.out binaries and take ~0 space.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/external/gpl3/binutils/dist/bfd/config.bfd
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/binutils/dist/bfd/configure
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/binutils/dist/bfd/configure.ac
cvs rdiff -u -r0 -r1.3 src/external/gpl3/binutils/dist/bfd/i386netbsd.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/binutils/dist/bfd/targets.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.32 src/external/gpl3/binutils/dist/bfd/config.bfd:1.33
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.32	Fri Apr  3 19:48:45 2020
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Sat Aug  8 15:26:09 2020
@@ -622,7 +622,7 @@ case "${targ}" in
 ;;
   i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu)
 targ_defvec=i386_elf32_vec
-targ_selvecs="iamcu_elf32_vec i386_coff_vec i386_pei_vec"
+targ_selvecs="iamcu_elf32_vec i386_coff_vec i386_pei_vec i386_aout_bsd_vec i386_aout_nbsd_vec"
 targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec x86_64_pei_vec"
 ;;
   i[3-7]86-*-netbsdpe*)
@@ -686,7 +686,7 @@ case "${targ}" in
 ;;
   x86_64-*-netbsd* | x86_64-*-openbsd*)
 targ_defvec=x86_64_elf64_vec
-targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
+targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec i386_aout_bsd_vec i386_aout_nbsd_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
 want64=true
 ;;
   x86_64-*-linux-*)

Index: src/external/gpl3/binutils/dist/bfd/configure
diff -u src/external/gpl3/binutils/dist/bfd/configure:1.15 src/external/gpl3/binutils/dist/bfd/configure:1.16
--- src/external/gpl3/binutils/dist/bfd/configure:1.15	Fri Apr  3 19:48:45 2020
+++ src/external/gpl3/binutils/dist/bfd/configure	Sat Aug  8 15:26:09 2020
@@ -14752,6 +14752,7 @@ do
 i386_aout_vec)		 tb="$tb i386aout.lo aout32.lo" ;;
 i386_aout_bsd_vec)		 tb="$tb i386bsd.lo aout32.lo" ;;
 i386_aout_lynx_vec)		 tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
+i386_aout_nbsd_vec)		 tb="$tb i386netbsd.lo aout32.lo" ;;
 i386_coff_vec)		 tb="$tb coff-i386.lo $coff" ;;
 i386_coff_go32_vec)		 tb="$tb coff-go32.lo $coff" ;;
 i386_coff_go32stubbed_vec)	 tb="$tb coff-stgo32.lo $coff" ;;

Index: src/external/gpl3/binutils/dist/bfd/configure.ac
diff -u src/external/gpl3/binutils/dist/bfd/configure.ac:1.8 src/external/gpl3/binutils/dist/bfd/configure.ac:1.9
--- src/external/gpl3/binutils/dist/bfd/configure.ac:1.8	Fri Apr  3 19:48:46 2020
+++ src/external/gpl3/binutils/dist/bfd/configure.ac	Sat Aug  8 15:26:09 2020
@@ -488,6 +488,7 @@ do
 i386_aout_vec)		 tb="$tb i386aout.lo aout32.lo" ;;
 i386_aout_bsd_vec)		 tb="$tb i386bsd.lo aout32.lo" ;;
 i386_aout_lynx_vec)		 tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
+i386_aout_nbsd_vec)		 tb="$tb i386netbsd.lo aout32.lo" ;;
 i386_coff_vec)		 tb="$tb coff-i386.lo $coff" ;;
 i386_coff_go32_vec)		 tb="$tb coff-go32.lo $coff" ;;
 i386_coff_go32stubbed_vec)	 tb="$tb coff-stgo32.lo $coff" ;;

Index: src/external/gpl3/binutils/dist/bfd/targets.c
diff -u src/external/gpl3/binutils/dist/bfd/targets.c:1.11 src/external/gpl3/binutils/dist/bfd/targets.c:1.12
--- src/external/gpl3/binutils/dist/bfd/targets.c:1.11	Fri Apr  3 19:48:46 2020
+++ src/external/gpl3/binutils/dist/bfd/targets.c	Sat Aug  8 15:26:09 2020
@@ -727,6 +727,7 @@ extern const bfd_target hppa_som_vec;
 extern const bfd_target i386_aout_vec;
 extern const bfd_target i386_aout_bsd_vec;
 extern const bfd_target i386_aout_lynx_vec;
+extern const bfd_target i386_aout_nbsd_vec;
 extern const bfd_target i386_coff_vec;
 extern const bfd_target i386_coff_go32_vec;
 extern const bfd_target i386_coff_go32stubbed_vec;

Added files:

Index: src/external/gpl3/binutils/dist/bfd/i386netbsd.c
diff -u /dev/null src/external/gpl3/binutils/dist/bfd/i386netbsd.c:1.3
--- /dev/null	Sat Aug  8 15:26:09 2020
+++ src/external/gpl3/binutils/dist/bfd/i386netbsd.c	Sat Aug  8 15:26:09 2020
@@ -0,0 +1,38 @@
+/* BFD back-end for NetBSD/386 a.out-ish binaries.
+   Copyright (C) 1990-2016 Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   

CVS commit: src/external/gpl3/binutils/dist/bfd

2020-04-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 15:30:05 UTC 2020

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf.c

Log Message:
Apply fix for --noinhibit-exec from:
https://www.mail-archive.com/bug-binutils@gnu.org/msg33090.html


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/binutils/dist/bfd/elf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf.c
diff -u src/external/gpl3/binutils/dist/bfd/elf.c:1.15 src/external/gpl3/binutils/dist/bfd/elf.c:1.16
--- src/external/gpl3/binutils/dist/bfd/elf.c:1.15	Fri Apr  3 19:48:46 2020
+++ src/external/gpl3/binutils/dist/bfd/elf.c	Sat Apr  4 11:30:05 2020
@@ -5948,7 +5948,11 @@ assign_file_positions_for_load_sections 
 	  _bfd_error_handler (_("%pB: error: PHDR segment not covered"
 " by LOAD segment"),
 			  abfd);
-	  return FALSE;
+	  if (link_info == NULL)
+	return FALSE;
+	  /* Arrange for the linker to exit with an error, deleting
+	 the output file unless --noinhibit-exec is given.  */
+	  link_info->callbacks->info ("%X");
 	}
 
   /* Check that all sections are in a PT_LOAD segment.



CVS commit: src/external/gpl3/binutils/dist/bfd

2019-05-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May  5 21:49:53 UTC 2019

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-arm.c

Log Message:
Ignore 0 size'd symbols when looking for CMSE veneers.
XXX: Is this correct?


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/binutils/dist/bfd/elf32-arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-arm.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.13 src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.14
--- src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.13	Tue Nov  6 20:13:52 2018
+++ src/external/gpl3/binutils/dist/bfd/elf32-arm.c	Sun May  5 17:49:53 2019
@@ -19661,7 +19661,7 @@ elf32_arm_swap_symbol_in (bfd * abfd,
 
   /* Mark CMSE special symbols.  */
   symtab_hdr = & elf_symtab_hdr (abfd);
-  if (symtab_hdr->sh_size)
+  if (symtab_hdr->sh_size && dst->st_size != 0)
 name = bfd_elf_sym_name (abfd, symtab_hdr, dst, NULL);
   if (name && CONST_STRNEQ (name, CMSE_PREFIX))
 ARM_SET_SYM_CMSE_SPCL (dst->st_target_internal);



CVS commit: src/external/gpl3/binutils/dist/bfd

2019-04-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 16 02:10:09 UTC 2019

Modified Files:
src/external/gpl3/binutils/dist/bfd: configure.ac

Log Message:
fix merge botch - remove duplicated case statement (not in configure)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/binutils/dist/bfd/configure.ac

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/configure.ac
diff -u src/external/gpl3/binutils/dist/bfd/configure.ac:1.6 src/external/gpl3/binutils/dist/bfd/configure.ac:1.7
--- src/external/gpl3/binutils/dist/bfd/configure.ac:1.6	Wed Nov  7 01:13:51 2018
+++ src/external/gpl3/binutils/dist/bfd/configure.ac	Tue Apr 16 02:10:09 2019
@@ -581,8 +581,6 @@ do
 ns32k_aout_pc532mach_vec)	 tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
 ns32k_aout_pc532nbsd_vec)	 tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
 or1k_elf32_vec)		 tb="$tb elf32-or1k.lo elf32.lo $elf" ;;
-riscv_elf32_vec)		 tb="$tb elf32-riskv.lo elffxx-riscv.lo elf32.lo $elf" ;;
-riscv_elf64_vec)		 tb="$tb elf64-riskv.lo elf64.lo elffxx-riscv.lo $elf" target_size=64 ;;
 pdp11_aout_vec)		 tb="$tb pdp11.lo" ;;
 pef_vec)			 tb="$tb pef.lo" ;;
 pef_xlib_vec)		 tb="$tb pef.lo" ;;



CVS commit: src/external/gpl3/binutils/dist/bfd

2018-12-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 30 22:48:31 UTC 2018

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-ppc.c

Log Message:
forgot to commit compilation fix.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/binutils/dist/bfd/elf32-ppc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.12 src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.13
--- src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.12	Tue Nov  6 20:13:52 2018
+++ src/external/gpl3/binutils/dist/bfd/elf32-ppc.c	Sun Dec 30 17:48:31 2018
@@ -5966,7 +5966,7 @@ ppc_elf_adjust_dynamic_symbol (struct bf
 		   && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)))
 	  && !htab->is_vxworks
 	  && !ppc_elf_hash_entry (h)->has_sda_refs
-	  && !readonly_dynrelocs (h, info, FALSE))
+	  && !readonly_dynrelocs (h))
 	{
 	  h->pointer_equality_needed = 0;
 	  /* If we haven't seen a branch reloc and the symbol



CVS commit: src/external/gpl3/binutils/dist/bfd

2018-11-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  8 02:30:06 UTC 2018

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
delete i386 aout vec which has been removed


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.26 src/external/gpl3/binutils/dist/bfd/config.bfd:1.27
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.26	Tue Nov  6 20:13:51 2018
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Wed Nov  7 21:30:06 2018
@@ -620,7 +620,7 @@ case "${targ}" in
 ;;
   i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu)
 targ_defvec=i386_elf32_vec
-targ_selvecs="i386_aout_nbsd_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec"
+targ_selvecs="iamcu_elf32_vec i386_coff_vec i386_pei_vec"
 targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec x86_64_pei_vec"
 ;;
   i[3-7]86-*-netbsdpe*)



CVS commit: src/external/gpl3/binutils/dist/bfd

2018-05-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May  6 15:14:12 UTC 2018

Modified Files:
src/external/gpl3/binutils/dist/bfd: elflink.c

Log Message:
add missed patch


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/binutils/dist/bfd/elflink.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elflink.c
diff -u src/external/gpl3/binutils/dist/bfd/elflink.c:1.15 src/external/gpl3/binutils/dist/bfd/elflink.c:1.16
--- src/external/gpl3/binutils/dist/bfd/elflink.c:1.15	Sun Apr 15 16:06:01 2018
+++ src/external/gpl3/binutils/dist/bfd/elflink.c	Sun May  6 11:14:12 2018
@@ -2804,6 +2804,8 @@ _bfd_elf_fix_symbol_flags (struct elf_li
   if (h->is_weakalias)
 {
   struct elf_link_hash_entry *def = weakdef (h);
+  while (def->root.type == bfd_link_hash_indirect)
+def = (struct elf_link_hash_entry *) def->root.u.i.link;
 
   /* If the real definition is defined by a regular object file,
 	 don't do anything special.  See the longer description in



CVS commit: src/external/gpl3/binutils/dist/bfd

2018-03-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Mar 27 23:39:23 UTC 2018

Modified Files:
src/external/gpl3/binutils/dist/bfd: elflink.c

Log Message:
When trying to decide the status of a weak symbol, resolve any
indirectness first. In the case of various Qt5 libraries, __bss_start
ends up with a Qt5 version, but it has to be resolved first to match the
actual (implicit) definition. This fixes the root cause of pkg/53089.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/binutils/dist/bfd/elflink.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elflink.c
diff -u src/external/gpl3/binutils/dist/bfd/elflink.c:1.13 src/external/gpl3/binutils/dist/bfd/elflink.c:1.14
--- src/external/gpl3/binutils/dist/bfd/elflink.c:1.13	Wed Oct 26 18:42:52 2016
+++ src/external/gpl3/binutils/dist/bfd/elflink.c	Tue Mar 27 23:39:23 2018
@@ -2675,14 +2675,17 @@ _bfd_elf_fix_symbol_flags (struct elf_li
  over to the real definition.  */
   if (h->u.weakdef != NULL)
 {
+  struct elf_link_hash_entry *weakdef = h->u.weakdef;
+  while (weakdef->root.type == bfd_link_hash_indirect)
+weakdef = (struct elf_link_hash_entry *) weakdef->root.u.i.link;
+
   /* If the real definition is defined by a regular object file,
 	 don't do anything special.  See the longer description in
 	 _bfd_elf_adjust_dynamic_symbol, below.  */
-  if (h->u.weakdef->def_regular)
+  if (weakdef->def_regular)
 	h->u.weakdef = NULL;
   else
 	{
-	  struct elf_link_hash_entry *weakdef = h->u.weakdef;
 
 	  while (h->root.type == bfd_link_hash_indirect)
 	h = (struct elf_link_hash_entry *) h->root.u.i.link;



CVS commit: src/external/gpl3/binutils/dist/bfd

2017-07-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jul 25 19:44:25 UTC 2017

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-sparc.c

Log Message:
TLS relocations for PIE and non-PIE main executable work the same, so
apply the same relaxation rules and the same static binding rules.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.11 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.12
--- src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.11	Wed Oct 26 18:42:52 2016
+++ src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c	Tue Jul 25 19:44:25 2017
@@ -1330,7 +1330,7 @@ sparc_elf_tls_transition (struct bfd_lin
   && ! _bfd_sparc_elf_tdata (abfd)->has_tlsgd)
 r_type = R_SPARC_REV32;
 
-  if (bfd_link_pic (info))
+  if (bfd_link_dll (info))
 return r_type;
 
   switch (r_type)
@@ -1501,13 +1501,13 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, 
 
 	case R_SPARC_TLS_LE_HIX22:
 	case R_SPARC_TLS_LE_LOX10:
-	  if (bfd_link_pic (info))
+	  if (bfd_link_dll (info))
 	goto r_sparc_plt32;
 	  break;
 
 	case R_SPARC_TLS_IE_HI22:
 	case R_SPARC_TLS_IE_LO10:
-	  if (bfd_link_pic (info))
+	  if (bfd_link_dll (info))
 	info->flags |= DF_STATIC_TLS;
 	  /* Fall through */
 
@@ -2334,7 +2334,7 @@ allocate_dynrelocs (struct elf_link_hash
   /* If R_SPARC_TLS_IE_{HI22,LO10} symbol is now local to the binary,
  make it a R_SPARC_TLS_LE_{HI22,LO10} requiring no TLS entry.  */
   if (h->got.refcount > 0
-  && !bfd_link_pic (info)
+  && !bfd_link_dll (info)
   && h->dynindx == -1
   && _bfd_sparc_elf_hash_entry(h)->tls_type == GOT_TLS_IE)
 h->got.offset = (bfd_vma) -1;
@@ -3582,7 +3582,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	  else if (h != NULL)
 	{
 	  tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type;
-	  if (!bfd_link_pic (info)
+	  if (!bfd_link_dll (info)
 		  && h->dynindx == -1
 		  && tls_type == GOT_TLS_IE)
 		switch (SPARC_ELF_R_TYPE (rel->r_info))
@@ -3706,7 +3706,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 
 	case R_SPARC_TLS_LDM_HI22:
 	case R_SPARC_TLS_LDM_LO10:
-	  if (! bfd_link_pic (info))
+	  if (! bfd_link_dll (info))
 	{
 	  bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset);
 	  continue;
@@ -3717,7 +3717,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 
 	case R_SPARC_TLS_LDO_HIX22:
 	case R_SPARC_TLS_LDO_LOX10:
-	  if (bfd_link_pic (info))
+	  if (bfd_link_dll (info))
 	{
 	  relocation -= dtpoff_base (info);
 	  break;
@@ -3729,7 +3729,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 
 	case R_SPARC_TLS_LE_HIX22:
 	case R_SPARC_TLS_LE_LOX10:
-	  if (bfd_link_pic (info))
+	  if (bfd_link_dll (info))
 	{
 	  Elf_Internal_Rela outrel;
 	  bfd_boolean skip;
@@ -3761,7 +3761,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	  break;
 
 	case R_SPARC_TLS_LDM_CALL:
-	  if (! bfd_link_pic (info))
+	  if (! bfd_link_dll (info))
 	{
 	  /* mov %g0, %o0 */
 	  bfd_put_32 (output_bfd, 0x9010, contents + rel->r_offset);
@@ -3775,13 +3775,13 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	tls_type = _bfd_sparc_elf_local_got_tls_type (input_bfd) [r_symndx];
 	  else if (h != NULL)
 	tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type;
-	  if (! bfd_link_pic (info)
+	  if (! bfd_link_dll (info)
 	  || (r_type == R_SPARC_TLS_GD_CALL && tls_type == GOT_TLS_IE))
 	{
 	  Elf_Internal_Rela *rel2;
 	  bfd_vma insn;
 
-	  if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
+	  if (!bfd_link_dll (info) && (h == NULL || h->dynindx == -1))
 		{
 		  /* GD -> LE */
 		  bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset);
@@ -3868,12 +3868,12 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	  continue;
 
 	case R_SPARC_TLS_LDM_ADD:
-	  if (! bfd_link_pic (info))
+	  if (! bfd_link_dll (info))
 	bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset);
 	  continue;
 
 	case R_SPARC_TLS_LDO_ADD:
-	  if (! bfd_link_pic (info))
+	  if (! bfd_link_dll (info))
 	{
 	  /* Change rs1 into %g7.  */
 	  bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
@@ -3884,7 +3884,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 
 	case R_SPARC_TLS_IE_LD:
 	case R_SPARC_TLS_IE_LDX:
-	  if (! bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
+	  if (! bfd_link_dll (info) && (h == NULL || h->dynindx == -1))
 	{
 	  bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
 	  int rs2 = insn & 0x1f;



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-12-30 Thread Brian Buhrow
Module Name:src
Committed By:   buhrow
Date:   Fri Dec 30 22:40:24 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-arm.c

Log Message:
Fix problem which prevents cross building on NetBSD systems which predate
NetBSD-6 or non-NetBSD systems.  See discussion on port-arm for details.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/binutils/dist/bfd/elf32-arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-arm.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.10 src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.11
--- src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.10	Wed Oct 26 18:42:52 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-arm.c	Fri Dec 30 22:40:23 2016
@@ -3207,8 +3207,8 @@ ctz (unsigned int mask)
 #endif
 }
 
-#ifndef __NetBSD__
-static inline int
+#if !defined (__NetBSD__) || (__NetBSD_Version__ < 6) 
+unsigned int
 popcount (unsigned int mask)
 {
 #if GCC_VERSION >= 3004



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-11-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Nov  4 00:19:32 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf64-ppc.c

Log Message:
Tail calls can use the PLT without a nop after the branch. Since the
callee won't return to the next instruction anyway, it wouldn't work
anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf64-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.10 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.11
--- src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.10	Thu Nov  3 01:22:59 2016
+++ src/external/gpl3/binutils/dist/bfd/elf64-ppc.c	Fri Nov  4 00:19:32 2016
@@ -14069,6 +14069,11 @@ ppc64_elf_relocate_section (bfd *output_
 			  can_plt_call = TRUE;
 			}
 		}
+		  else
+		{
+		  /* Tail calls don't need to worry about restoring TOC. */
+		  can_plt_call = TRUE;
+		}
 		}
 
 	  if (!can_plt_call && h != NULL)



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-11-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  3 01:22:59 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-ppc.c elf64-ppc.c

Log Message:
More detailed error messages for text relocations on ppc code. Tested by joerg@


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/binutils/dist/bfd/elf32-ppc.c \
src/external/gpl3/binutils/dist/bfd/elf64-ppc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.9 src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.10
--- src/external/gpl3/binutils/dist/bfd/elf32-ppc.c:1.9	Wed Oct 26 14:42:52 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-ppc.c	Wed Nov  2 21:22:59 2016
@@ -5557,7 +5557,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUT
 /* Return true if we have dynamic relocs that apply to read-only sections.  */
 
 static bfd_boolean
-readonly_dynrelocs (struct elf_link_hash_entry *h)
+readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf, bfd_boolean warn)
 {
   struct elf_dyn_relocs *p;
 
@@ -5568,7 +5568,16 @@ readonly_dynrelocs (struct elf_link_hash
   if (s != NULL
 	  && ((s->flags & (SEC_READONLY | SEC_ALLOC))
 	  == (SEC_READONLY | SEC_ALLOC)))
-	return TRUE;
+	{
+	  struct bfd_link_info *info = (struct bfd_link_info *) inf;
+
+	  if (warn && ((info->warn_shared_textrel && bfd_link_pic (info))
+	  || info->error_textrel))
+	info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' in readonly section `%A'\n"),
+p->sec->owner, h->root.root.string,
+p->sec);
+	  return TRUE;
+	}
 }
   return FALSE;
 }
@@ -5642,7 +5651,7 @@ ppc_elf_adjust_dynamic_symbol (struct bf
 	  && h->type != STT_GNU_IFUNC
 	  && !htab->is_vxworks
 	  && !ppc_elf_hash_entry (h)->has_sda_refs
-	  && !readonly_dynrelocs (h))
+	  && !readonly_dynrelocs (h, info, FALSE))
 	{
 	  h->pointer_equality_needed = 0;
 	  h->non_got_ref = 0;
@@ -5662,7 +5671,7 @@ ppc_elf_adjust_dynamic_symbol (struct bf
 		   && h->type != STT_GNU_IFUNC
 		   && !htab->is_vxworks
 		   && !ppc_elf_hash_entry (h)->has_sda_refs
-		   && !readonly_dynrelocs (h))
+		   && !readonly_dynrelocs (h, info, FALSE))
 	h->non_got_ref = 0;
 	}
   h->protected_def = 0;
@@ -5739,7 +5748,7 @@ ppc_elf_adjust_dynamic_symbol (struct bf
   && !ppc_elf_hash_entry (h)->has_sda_refs
   && !htab->is_vxworks
   && !h->def_regular
-  && !readonly_dynrelocs (h))
+  && !readonly_dynrelocs (h, info, FALSE))
 {
   h->non_got_ref = 0;
   return TRUE;
@@ -6249,7 +6258,7 @@ maybe_set_textrel (struct elf_link_hash_
   if (h->root.type == bfd_link_hash_indirect)
 return TRUE;
 
-  if (readonly_dynrelocs (h))
+  if (readonly_dynrelocs (h, info, TRUE))
 {
   ((struct bfd_link_info *) info)->flags |= DF_TEXTREL;
 
Index: src/external/gpl3/binutils/dist/bfd/elf64-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.9 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.10
--- src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.9	Wed Oct 26 14:42:52 2016
+++ src/external/gpl3/binutils/dist/bfd/elf64-ppc.c	Wed Nov  2 21:22:59 2016
@@ -7105,7 +7105,7 @@ ppc64_elf_func_desc_adjust (bfd *obfd AT
 /* Return true if we have dynamic relocs that apply to read-only sections.  */
 
 static bfd_boolean
-readonly_dynrelocs (struct elf_link_hash_entry *h)
+readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf, bfd_boolean warn)
 {
   struct ppc_link_hash_entry *eh;
   struct elf_dyn_relocs *p;
@@ -7116,7 +7116,16 @@ readonly_dynrelocs (struct elf_link_hash
   asection *s = p->sec->output_section;
 
   if (s != NULL && (s->flags & SEC_READONLY) != 0)
-	return TRUE;
+	{
+	  struct bfd_link_info *info = (struct bfd_link_info *) inf;
+
+	  if (warn && ((info->warn_shared_textrel && bfd_link_pic (info))
+	  || info->error_textrel))
+	info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' in readonly section `%A'\n"),
+p->sec->owner, h->root.root.string,
+p->sec);
+	  return TRUE;
+	}
 }
   return FALSE;
 }
@@ -7168,7 +7177,7 @@ ppc64_elf_adjust_dynamic_symbol (struct 
 	 be used instead.  */
 	  if (h->pointer_equality_needed
 	  && h->type != STT_GNU_IFUNC
-	  && !readonly_dynrelocs (h))
+	  && !readonly_dynrelocs (h, info, FALSE))
 	{
 	  h->pointer_equality_needed = 0;
 	  h->non_got_ref = 0;
@@ -7186,7 +7195,7 @@ ppc64_elf_adjust_dynamic_symbol (struct 
 	  else if (!h->ref_regular_nonweak
 		   && h->non_got_ref
 		   && h->type != STT_GNU_IFUNC
-		   && !readonly_dynrelocs (h))
+		   && !readonly_dynrelocs (h, info, FALSE))
 	h->non_got_ref = 0;
 
 	  /* If making a plt entry, then we don't need copy relocs.  */
@@ -7235,7 +7244,7 @@ ppc64_elf_adjust_dynamic_symbol (struct 
 

CVS commit: src/external/gpl3/binutils/dist/bfd

2016-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  5 14:25:33 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-sparc.c

Log Message:
more errors for text relocations


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.9 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.10
--- src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.9	Mon Sep  5 05:17:35 2016
+++ src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c	Mon Sep  5 10:25:33 2016
@@ -2616,7 +2616,13 @@ _bfd_sparc_elf_size_dynamic_sections (bf
 		srel = htab->elf.irelplt;
 		  srel->size += p->count * SPARC_ELF_RELA_BYTES (htab);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
-		info->flags |= DF_TEXTREL;
+		{
+		  info->flags |= DF_TEXTREL;
+		  if ((info->warn_shared_textrel && bfd_link_pic (info))
+			|| info->error_textrel)
+			info->callbacks->einfo (_("%P: %B: warning: relocation "
+			  "in readonly section `%A'\n"), p->sec->owner, p->sec);
+		}
 		}
 	}
 	}



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  5 09:17:35 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-sparc.c

Log Message:
sync error with x86_64.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.8 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.9
--- src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.8	Wed Jun 15 10:47:23 2016
+++ src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c	Mon Sep  5 05:17:35 2016
@@ -2514,12 +2514,14 @@ readonly_dynrelocs (struct elf_link_hash
 	{
 	  struct bfd_link_info *info = (struct bfd_link_info *) inf;
 
-  if (info->warn_shared_textrel)
-(*_bfd_error_handler)
-  (_("warning: dynamic relocation to `%s' in readonly section `%s'"),
-  h->root.root.string, s->name);
 	  info->flags |= DF_TEXTREL;
 
+	  if ((info->warn_shared_textrel && bfd_link_pic (info))
+	  || info->error_textrel)
+	info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' in readonly section `%A'\n"),
+p->sec->owner, h->root.root.string,
+p->sec);
+
 	  /* Not an error, just cut short the traversal.  */
 	  return FALSE;
 	}



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-07-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul 21 00:10:57 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-vax.c

Log Message:
don't die printing a name we don't have


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/binutils/dist/bfd/elf32-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-vax.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.13 src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.14
--- src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.13	Wed Jun 15 10:47:23 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-vax.c	Wed Jul 20 20:10:57 2016
@@ -782,7 +782,7 @@ elf_vax_check_relocs (bfd *abfd, struct 
 			if (info->warn_shared_textrel)
 			  (*_bfd_error_handler)
 			(_("warning: dynamic relocation to `%s' in readonly section `%s'"),
-			 h->root.root.string, sec->name);
+			 h ? h->root.root.string : "?", sec->name);
 			info->flags |= DF_TEXTREL;
 		}
 		}



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-06-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jun 26 14:44:10 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-m68k.c

Log Message:
fix build


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-m68k.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.8 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.9
--- src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.8	Wed Jun 15 14:47:23 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-m68k.c	Sun Jun 26 14:44:10 2016
@@ -3440,7 +3440,7 @@ elf_m68k_discard_copies (struct elf_link
 		if (info->warn_shared_textrel)
 		  (*_bfd_error_handler)
 		(_("warning: dynamic relocation to `%s' in readonly section `%s'"),
-		h->root.root.string, s->name); 
+		h->root.root.string, s->section->name); 
 		info->flags |= DF_TEXTREL;
 		break;
 	  }



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-06-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 15 14:47:23 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-hppa.c elf32-i386.c
elf32-m68k.c elf32-sh.c elf32-vax.c elfxx-sparc.c

Log Message:
Harmonize the error messages about dynamic relocations.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/binutils/dist/bfd/elf32-hppa.c \
src/external/gpl3/binutils/dist/bfd/elf32-m68k.c \
src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/binutils/dist/bfd/elf32-i386.c \
src/external/gpl3/binutils/dist/bfd/elf32-sh.c
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/binutils/dist/bfd/elf32-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-hppa.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-hppa.c:1.7 src/external/gpl3/binutils/dist/bfd/elf32-hppa.c:1.8
--- src/external/gpl3/binutils/dist/bfd/elf32-hppa.c:1.7	Fri Jan 29 09:42:44 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-hppa.c	Wed Jun 15 10:47:23 2016
@@ -2185,8 +2185,8 @@ readonly_dynrelocs (struct elf_link_hash
 
   if (info->warn_shared_textrel)
 (*_bfd_error_handler)
-  (_("warning: dynamic relocation in readonly section `%s'"),
-  eh->root.root.string);
+  (_("warning: dynamic relocation to `%s' in readonly section `%s'"),
+  eh->root.root.string, sec->name);
 	  info->flags |= DF_TEXTREL;
 
 	  /* Not an error, just cut short the traversal.  */
Index: src/external/gpl3/binutils/dist/bfd/elf32-m68k.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.7 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.8
--- src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.7	Fri Apr 22 13:40:36 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-m68k.c	Wed Jun 15 10:47:23 2016
@@ -2816,8 +2816,8 @@ elf_m68k_check_relocs (bfd *abfd,
 		{
 		  if (info->warn_shared_textrel)
 		(*_bfd_error_handler)
-		  (_("warning: dynamic relocation in readonly section `%s'"),
-		  h->root.root.string); 
+		  (_("warning: dynamic relocation to `%s' in readonly section `%s'"),
+		  h->root.root.string, sec->name); 
 		  info->flags |= DF_TEXTREL;
 		}
 
@@ -3439,8 +3439,8 @@ elf_m68k_discard_copies (struct elf_link
 	  {
 		if (info->warn_shared_textrel)
 		  (*_bfd_error_handler)
-		(_("warning: dynamic relocation in readonly section `%s'"),
-		h->root.root.string); 
+		(_("warning: dynamic relocation to `%s' in readonly section `%s'"),
+		h->root.root.string, s->name); 
 		info->flags |= DF_TEXTREL;
 		break;
 	  }
Index: src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.7 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.8
--- src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.7	Fri Jan 29 09:42:44 2016
+++ src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c	Wed Jun 15 10:47:23 2016
@@ -2516,8 +2516,8 @@ readonly_dynrelocs (struct elf_link_hash
 
   if (info->warn_shared_textrel)
 (*_bfd_error_handler)
-  (_("warning: dynamic relocation in readonly section `%s'"),
-  h->root.root.string);
+  (_("warning: dynamic relocation to `%s' in readonly section `%s'"),
+  h->root.root.string, s->name);
 	  info->flags |= DF_TEXTREL;
 
 	  /* Not an error, just cut short the traversal.  */

Index: src/external/gpl3/binutils/dist/bfd/elf32-i386.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-i386.c:1.6 src/external/gpl3/binutils/dist/bfd/elf32-i386.c:1.7
--- src/external/gpl3/binutils/dist/bfd/elf32-i386.c:1.6	Fri Jan 29 09:42:44 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-i386.c	Wed Jun 15 10:47:23 2016
@@ -2718,8 +2718,8 @@ elf_i386_readonly_dynrelocs (struct elf_
 	  struct bfd_link_info *info = (struct bfd_link_info *) inf;
 	  if (info->warn_shared_textrel)
 	(*_bfd_error_handler)
-	  (_("warning: dynamic relocation in readonly section `%s'"),
-	  h->root.root.string); 
+	  (_("warning: dynamic relocation to `%s' in readonly section `%s'"),
+	  h->root.root.string, s->name); 
 	  info->flags |= DF_TEXTREL;
 
 	  if ((info->warn_shared_textrel && bfd_link_pic (info))
Index: src/external/gpl3/binutils/dist/bfd/elf32-sh.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-sh.c:1.6 src/external/gpl3/binutils/dist/bfd/elf32-sh.c:1.7
--- src/external/gpl3/binutils/dist/bfd/elf32-sh.c:1.6	Fri Jan 29 09:42:44 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-sh.c	Wed Jun 15 10:47:23 2016
@@ -3304,8 +3304,8 @@ readonly_dynrelocs (struct elf_link_hash
 
   if (info->warn_shared_textrel)
 (*_bfd_error_handler)
-  (_("warning: dynamic relocation in readonly section `%s'"),
-  h->root.root.string);
+   

CVS commit: src/external/gpl3/binutils/dist/bfd

2016-04-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr 29 16:25:55 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elflink.c

Log Message:
Revert. For whatever reasons, the ELF visibility attributes are not
meant to be a useful indicator of what an object expects, so for linking
against a protected symbol, it must be declared as normal.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/binutils/dist/bfd/elflink.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elflink.c
diff -u src/external/gpl3/binutils/dist/bfd/elflink.c:1.10 src/external/gpl3/binutils/dist/bfd/elflink.c:1.11
--- src/external/gpl3/binutils/dist/bfd/elflink.c:1.10	Fri Mar 25 23:04:41 2016
+++ src/external/gpl3/binutils/dist/bfd/elflink.c	Fri Apr 29 16:25:55 2016
@@ -1252,7 +1252,6 @@ _bfd_elf_merge_symbol (bfd *abfd,
  definition from a dynamic object.  */
   if (newdyn
   && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
-  && ELF_ST_VISIBILITY (h->other) != STV_PROTECTED
   && !bfd_is_und_section (sec))
 {
   *skip = TRUE;
@@ -1270,7 +1269,6 @@ _bfd_elf_merge_symbol (bfd *abfd,
 }
   else if (!newdyn
 	   && ELF_ST_VISIBILITY (sym->st_other) != STV_DEFAULT
-	   && ELF_ST_VISIBILITY (sym->st_other) != STV_PROTECTED
 	   && h->def_dynamic)
 {
   /* If the new symbol with non-default visibility comes from a
@@ -9337,11 +9335,10 @@ elf_link_output_extsym (struct bfd_hash_
   && h->def_dynamic)
 sym.st_size = 0;
 
-  /* If a non-weak symbol with non-public visibility is not defined
+  /* If a non-weak symbol with non-default visibility is not defined
  locally, it is a fatal error.  */
   if (!bfd_link_relocatable (flinfo->info)
   && ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT
-  && ELF_ST_VISIBILITY (sym.st_other) != STV_PROTECTED
   && ELF_ST_BIND (sym.st_info) != STB_WEAK
   && h->root.type == bfd_link_hash_undefined
   && !h->def_regular)



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 22 17:40:36 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-m68k.c

Log Message:
Print the symbol that caused the text relocation for m68k like we do for
other platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-m68k.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.6 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.7
--- src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.6	Fri Jan 29 09:42:44 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-m68k.c	Fri Apr 22 13:40:36 2016
@@ -2813,7 +2813,13 @@ elf_m68k_check_relocs (bfd *abfd,
 		  && !(ELF32_R_TYPE (rel->r_info) == R_68K_PC8
 		   || ELF32_R_TYPE (rel->r_info) == R_68K_PC16
 		   || ELF32_R_TYPE (rel->r_info) == R_68K_PC32))
-		info->flags |= DF_TEXTREL;
+		{
+		  if (info->warn_shared_textrel)
+		(*_bfd_error_handler)
+		  (_("warning: dynamic relocation in readonly section `%s'"),
+		  h->root.root.string); 
+		  info->flags |= DF_TEXTREL;
+		}
 
 	  sreloc->size += sizeof (Elf32_External_Rela);
 
@@ -3431,6 +3437,10 @@ elf_m68k_discard_copies (struct elf_link
 	   s = s->next)
 	if ((s->section->flags & SEC_READONLY) != 0)
 	  {
+		if (info->warn_shared_textrel)
+		  (*_bfd_error_handler)
+		(_("warning: dynamic relocation in readonly section `%s'"),
+		h->root.root.string); 
 		info->flags |= DF_TEXTREL;
 		break;
 	  }



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-04-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  4 06:58:48 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: configure configure.ac

Log Message:
Don't use secureplt on alpha yet


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/binutils/dist/bfd/configure
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/binutils/dist/bfd/configure.ac

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/configure
diff -u src/external/gpl3/binutils/dist/bfd/configure:1.9 src/external/gpl3/binutils/dist/bfd/configure:1.10
--- src/external/gpl3/binutils/dist/bfd/configure:1.9	Fri Jan 29 18:05:18 2016
+++ src/external/gpl3/binutils/dist/bfd/configure	Mon Apr  4 06:58:48 2016
@@ -12147,7 +12147,7 @@ if test "${enable_secureplt+set}" = set;
   *)as_fn_error "bad value ${enableval} for secureplt option" "$LINENO" 5 ;;
 esac
 else
-  use_secureplt=true
+  use_secureplt=false
 fi
 if test $use_secureplt = true; then
 

Index: src/external/gpl3/binutils/dist/bfd/configure.ac
diff -u src/external/gpl3/binutils/dist/bfd/configure.ac:1.2 src/external/gpl3/binutils/dist/bfd/configure.ac:1.3
--- src/external/gpl3/binutils/dist/bfd/configure.ac:1.2	Fri Jan 29 18:05:18 2016
+++ src/external/gpl3/binutils/dist/bfd/configure.ac	Mon Apr  4 06:58:48 2016
@@ -82,7 +82,7 @@ AC_ARG_ENABLE(secureplt,
   yes)  use_secureplt=true  ;;
   no)   use_secureplt=false ;;
   *)AC_MSG_ERROR(bad value ${enableval} for secureplt option) ;;
-esac],[use_secureplt=true])dnl
+esac],[use_secureplt=false])dnl
 if test $use_secureplt = true; then
   AC_DEFINE(USE_SECUREPLT, 1,
 [Define if we should default to creating read-only plt entries])



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-03-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Mar 28 09:01:24 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
Add some more mips targets for martin


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.21 src/external/gpl3/binutils/dist/bfd/config.bfd:1.22
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.21	Fri Mar 25 09:27:43 2016
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Mon Mar 28 09:01:24 2016
@@ -1082,11 +1082,11 @@ case "${targ}" in
 ;;
   mips*el-*-netbsd*)
 targ_defvec=mips_elf32_trad_le_vec
-targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
+targ_selvecs="mips_elf32_trad_be_vec mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
 ;;
   mips*-*-netbsd*)
 targ_defvec=mips_elf32_trad_be_vec
-targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
+targ_selvecs="mips_elf32_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec mips_ecoff_be_vec mips_ecoff_le_vec"
 ;;
   mips64*-*-openbsd*)
 targ_defvec=mips_elf64_trad_be_vec



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-03-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Mar 25 23:04:41 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elflink.c

Log Message:
If a protected symbol is defined in a shared library, it should still
provide an implementation. Fix the merging rules.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/binutils/dist/bfd/elflink.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elflink.c
diff -u src/external/gpl3/binutils/dist/bfd/elflink.c:1.9 src/external/gpl3/binutils/dist/bfd/elflink.c:1.10
--- src/external/gpl3/binutils/dist/bfd/elflink.c:1.9	Fri Jan 29 14:42:44 2016
+++ src/external/gpl3/binutils/dist/bfd/elflink.c	Fri Mar 25 23:04:41 2016
@@ -1252,6 +1252,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
  definition from a dynamic object.  */
   if (newdyn
   && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+  && ELF_ST_VISIBILITY (h->other) != STV_PROTECTED
   && !bfd_is_und_section (sec))
 {
   *skip = TRUE;
@@ -1269,6 +1270,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
 }
   else if (!newdyn
 	   && ELF_ST_VISIBILITY (sym->st_other) != STV_DEFAULT
+	   && ELF_ST_VISIBILITY (sym->st_other) != STV_PROTECTED
 	   && h->def_dynamic)
 {
   /* If the new symbol with non-default visibility comes from a
@@ -9335,10 +9337,11 @@ elf_link_output_extsym (struct bfd_hash_
   && h->def_dynamic)
 sym.st_size = 0;
 
-  /* If a non-weak symbol with non-default visibility is not defined
+  /* If a non-weak symbol with non-public visibility is not defined
  locally, it is a fatal error.  */
   if (!bfd_link_relocatable (flinfo->info)
   && ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT
+  && ELF_ST_VISIBILITY (sym.st_other) != STV_PROTECTED
   && ELF_ST_BIND (sym.st_info) != STB_WEAK
   && h->root.type == bfd_link_hash_undefined
   && !h->def_regular)



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-03-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Mar 25 09:27:43 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
Fix mergo for mips


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.20 src/external/gpl3/binutils/dist/bfd/config.bfd:1.21
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.20	Sun Mar  6 09:39:42 2016
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Fri Mar 25 09:27:43 2016
@@ -998,16 +998,7 @@ case "${targ}" in
 targ_defvec=mips_ecoff_be_vec
 targ_selvecs=mips_ecoff_le_vec
 ;;
-#ifdef BFD64
-  mips*el-*-netbsd*)
-targ_defvec=mips_elf32_trad_le_vec
-targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
-;;
-  mips*-*-netbsd*)
-targ_defvec=mips_elf32_trad_be_vec
-targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
-;;
-#endif
+
   mips*-dec-* | mips*el-*-ecoff*)
 targ_defvec=mips_ecoff_le_vec
 targ_selvecs=mips_ecoff_be_vec
@@ -1081,6 +1072,22 @@ case "${targ}" in
 targ_defvec=mips_elf32_be_vec
 targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
 ;;
+  mips64*el-*-netbsd*)
+targ_defvec=mips_elf32_ntrad_le_vec
+targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
+;;
+  mips64*-*-netbsd*)
+targ_defvec=mips_elf32_ntrad_be_vec
+targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
+;;
+  mips*el-*-netbsd*)
+targ_defvec=mips_elf32_trad_le_vec
+targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec"
+;;
+  mips*-*-netbsd*)
+targ_defvec=mips_elf32_trad_be_vec
+targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
+;;
   mips64*-*-openbsd*)
 targ_defvec=mips_elf64_trad_be_vec
 targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec"



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-03-06 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sun Mar  6 09:39:42 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
Remove unnecessary local change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.19 src/external/gpl3/binutils/dist/bfd/config.bfd:1.20
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.19	Sun Mar  6 09:38:08 2016
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Sun Mar  6 09:39:42 2016
@@ -1611,10 +1611,6 @@ case "${targ}" in
 targ_selvecs="sparc_elf32_vec sparc_aout_linux_vec sparc_aout_sunos_be_vec"
 want64=true
 ;;
-  sparc64-*-netbsd*)
-targ_defvec=bfd_elf64_sparc_vec
-targ_selvecs="bfd_elf32_sparc_vec sparcnetbsd_vec sunos_big_vec"
-;;
   sparc64-*-elf* | sparc64-*-rtems* )
 targ_defvec=sparc_elf64_vec
 targ_selvecs=sparc_elf32_vec



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-02-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb  3 13:24:12 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
Fix mergo


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.17 src/external/gpl3/binutils/dist/bfd/config.bfd:1.18
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.17	Fri Jan 29 20:54:09 2016
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Wed Feb  3 13:24:12 2016
@@ -287,11 +287,11 @@ case "${targ}" in
 targ64_selvecs="x86_64_elf32_nacl_vec x86_64_elf64_nacl_vec"
 targ_archs="$targ_archs bfd_i386_arch"
 ;;
-  armeb-*-netbsdelf*)
+  arm*eb-*-netbsdelf*)
 targ_defvec=arm_elf32_be_vec
 targ_selvecs="arm_elf32_le_vec arm_aout_nbsd_vec"
 ;;
-  arm-*-netbsdelf*)
+  arm*-*-netbsdelf*)
 targ_defvec=arm_elf32_le_vec
 targ_selvecs="arm_elf32_be_vec arm_aout_nbsd_vec"
 ;;



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-01-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 29 18:05:18 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd configure configure.ac
targets.c

Log Message:
try to adjust riscv


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/binutils/dist/bfd/config.bfd
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/binutils/dist/bfd/configure
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/binutils/dist/bfd/configure.ac
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/bfd/targets.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.15 src/external/gpl3/binutils/dist/bfd/config.bfd:1.16
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.15	Fri Jan 29 09:42:43 2016
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Fri Jan 29 13:05:18 2016
@@ -1363,8 +1363,8 @@ case "${targ}" in
 
 #ifdef BFD64 
   riscv*-*-*)
-targ_defvec=bfd_elf64_riscv_vec
-targ_selvecs="bfd_elf32_riscv_vec bfd_elf64_riscv_vec"
+targ_defvec=riscv_elf64_vec
+targ_selvecs="riscv_elf32_vec riscv_elf64_vec"
 want64=true  
 ;;
 #endif   

Index: src/external/gpl3/binutils/dist/bfd/configure
diff -u src/external/gpl3/binutils/dist/bfd/configure:1.8 src/external/gpl3/binutils/dist/bfd/configure:1.9
--- src/external/gpl3/binutils/dist/bfd/configure:1.8	Fri Jan 29 09:42:43 2016
+++ src/external/gpl3/binutils/dist/bfd/configure	Fri Jan 29 13:05:18 2016
@@ -15453,6 +15453,8 @@ do
 ns32k_aout_pc532mach_vec)	 tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
 ns32k_aout_pc532nbsd_vec)	 tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
 or1k_elf32_vec)		 tb="$tb elf32-or1k.lo elf32.lo $elf" ;;
+riscv_elf32_vec)		 tb="$tb elf32-riscv.lo elfxx-riscv.lo elf32.lo $elf" ;;
+riscv_elf64_vec)		 tb="$tb elf64-riscv.lo elf64.lo elfxx-riscv.lo $elf"; target_size=64 ;;
 pdp11_aout_vec)		 tb="$tb pdp11.lo" ;;
 pef_vec)			 tb="$tb pef.lo" ;;
 pef_xlib_vec)		 tb="$tb pef.lo" ;;

Index: src/external/gpl3/binutils/dist/bfd/configure.ac
diff -u src/external/gpl3/binutils/dist/bfd/configure.ac:1.1.1.1 src/external/gpl3/binutils/dist/bfd/configure.ac:1.2
--- src/external/gpl3/binutils/dist/bfd/configure.ac:1.1.1.1	Fri Jan 29 07:44:14 2016
+++ src/external/gpl3/binutils/dist/bfd/configure.ac	Fri Jan 29 13:05:18 2016
@@ -898,6 +898,8 @@ do
 ns32k_aout_pc532mach_vec)	 tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
 ns32k_aout_pc532nbsd_vec)	 tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
 or1k_elf32_vec)		 tb="$tb elf32-or1k.lo elf32.lo $elf" ;;
+riscv_elf32_vec)		 tb="$tb elf32-riskv.lo elffxx-riscv.lo elf32.lo $elf" ;;
+riscv_elf64_vec)		 tb="$tb elf64-riskv.lo elf64.lo elffxx-riscv.lo $elf" target_size=64 ;;
 pdp11_aout_vec)		 tb="$tb pdp11.lo" ;;
 pef_vec)			 tb="$tb pef.lo" ;;
 pef_xlib_vec)		 tb="$tb pef.lo" ;;

Index: src/external/gpl3/binutils/dist/bfd/targets.c
diff -u src/external/gpl3/binutils/dist/bfd/targets.c:1.5 src/external/gpl3/binutils/dist/bfd/targets.c:1.6
--- src/external/gpl3/binutils/dist/bfd/targets.c:1.5	Fri Jan 29 09:42:44 2016
+++ src/external/gpl3/binutils/dist/bfd/targets.c	Fri Jan 29 13:05:18 2016
@@ -793,6 +793,8 @@ extern const bfd_target powerpc_pe_le_ve
 extern const bfd_target powerpc_pei_vec;
 extern const bfd_target powerpc_pei_le_vec;
 extern const bfd_target powerpc_xcoff_vec;
+extern const bfd_target riscv_elf32_vec;
+extern const bfd_target riscv_elf64_vec;
 extern const bfd_target rl78_elf32_vec;
 extern const bfd_target rs6000_xcoff64_vec;
 extern const bfd_target rs6000_xcoff64_aix_vec;
@@ -1295,9 +1297,11 @@ static const bfd_target * const _bfd_tar
 	_xcoff_vec,
 #endif
 
+	_elf32_vec,
 	_elf32_vec,
 
 #ifdef BFD64
+_elf64_vec,
 	_xcoff64_vec,
 	_xcoff64_aix_vec,
 #endif



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-01-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 29 22:39:00 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfnn-riscv.c

Log Message:
fix bfd for riscv.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c
diff -u src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c:1.2 src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c:1.3
--- src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c:1.2	Sat Mar 28 03:51:20 2015
+++ src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c	Fri Jan 29 17:39:00 2016
@@ -26,10 +26,12 @@
 
 #include "sysdep.h"
 #include "bfd.h"
+#include "libiberty.h"
 #include "libbfd.h"
-#include "bfdlink.h"
-#include "genlink.h"
+#include "bfd_stdint.h"
 #include "elf-bfd.h"
+#include "bfdlink.h"
+#include "objalloc.h"
 #include "elfxx-riscv.h"
 #include "elf/riscv.h"
 #include "opcode/riscv.h"
@@ -358,7 +360,7 @@ riscv_elf_create_dynamic_sections (bfd *
 return FALSE;
 
   htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss");
-  if (!info->shared)
+  if (!bfd_link_pic (info))
 {
   htab->srelbss = bfd_get_linker_section (dynobj, ".rela.bss");
   htab->sdyntdata =
@@ -367,7 +369,7 @@ riscv_elf_create_dynamic_sections (bfd *
 }
 
   if (!htab->elf.splt || !htab->elf.srelplt || !htab->sdynbss
-  || (!info->shared && (!htab->srelbss || !htab->sdyntdata)))
+  || (!bfd_link_pic (info) && (!htab->srelbss || !htab->sdyntdata)))
 abort ();
 
   return TRUE;
@@ -498,7 +500,7 @@ riscv_elf_check_relocs (bfd *abfd, struc
   const Elf_Internal_Rela *rel;
   asection *sreloc = NULL;
 
-  if (info->relocatable)
+  if (bfd_link_relocatable (info))
 return TRUE;
 
   htab = riscv_elf_hash_table (info);
@@ -547,7 +549,7 @@ riscv_elf_check_relocs (bfd *abfd, struc
 	  break;
 
 	case R_RISCV_TLS_GOT_HI20:
-	  if (info->shared)
+	  if (bfd_link_pic (info))
 	info->flags |= DF_STATIC_TLS;
 	  if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx)
 	  || !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE))
@@ -579,19 +581,19 @@ riscv_elf_check_relocs (bfd *abfd, struc
 	case R_RISCV_BRANCH:
 	case R_RISCV_PCREL_HI20:
 	  /* In shared libs, these relocs are known to bind locally.  */
-	  if (info->shared)
+	  if (bfd_link_pic (info))
 	break;
 	  goto static_reloc;
 
 	case R_RISCV_TPREL_HI20:
-	  if (!info->executable)
+	  if (!bfd_link_executable (info))
 	return bad_static_reloc (abfd, r_type, h);
 	  if (h != NULL)
 	riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE);
 	  goto static_reloc;
 
 	case R_RISCV_HI20:
-	  if (info->shared)
+	  if (bfd_link_pic (info))
 	return bad_static_reloc (abfd, r_type, h);
 	  /* Fall through.  */
 
@@ -606,7 +608,7 @@ riscv_elf_check_relocs (bfd *abfd, struc
 	  if (h != NULL)
 	h->non_got_ref = 1;
 
-	  if (h != NULL && !info->shared)
+	  if (h != NULL && !bfd_link_pic (info))
 	{
 	  /* We may need a .plt entry if the function this reloc
 		 refers to is in a shared lib.  */
@@ -634,14 +636,14 @@ riscv_elf_check_relocs (bfd *abfd, struc
 	 may need to keep relocations for symbols satisfied by a
 	 dynamic library if we manage to avoid copy relocs for the
 	 symbol.  */
-	  if ((info->shared
+	  if ((bfd_link_pic (info)
 	   && (sec->flags & SEC_ALLOC) != 0
 	   && (! riscv_elf_rtype_to_howto (r_type)->pc_relative
 		   || (h != NULL
 		   && (! info->symbolic
 			   || h->root.type == bfd_link_hash_defweak
 			   || !h->def_regular
-	  || (!info->shared
+	  || (!bfd_link_pic (info)
 		  && (sec->flags & SEC_ALLOC) != 0
 		  && h != NULL
 		  && (h->root.type == bfd_link_hash_defweak
@@ -757,7 +759,7 @@ riscv_elf_gc_sweep_hook (bfd *abfd, stru
   struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd);
   bfd_signed_vma *local_got_refcounts = elf_local_got_refcounts (abfd);
 
-  if (info->relocatable)
+  if (bfd_link_relocatable (info))
 return TRUE;
 
   elf_section_data (sec)->local_dynrel = NULL;
@@ -816,7 +818,7 @@ riscv_elf_gc_sweep_hook (bfd *abfd, stru
 	case R_RISCV_BRANCH:
 	case R_RISCV_CALL:
 	case R_RISCV_JAL:
-	  if (info->shared)
+	  if (bfd_link_pic (info))
 	break;
 	  /* Fall through.  */
 
@@ -908,7 +910,7 @@ riscv_elf_adjust_dynamic_symbol (struct 
  only references to the symbol are via the global offset table.
  For such cases we need not do anything here; the relocations will
  be handled correctly by relocate_section.  */
-  if (info->shared)
+  if (bfd_link_pic (info))
 return TRUE;
 
   /* If there are no references to this symbol that do not use the
@@ -960,9 +962,9 @@ riscv_elf_adjust_dynamic_symbol (struct 
 }
 
   if (eh->tls_type & ~GOT_NORMAL)
-return _bfd_elf_adjust_dynamic_copy (h, htab->sdyntdata);

CVS commit: src/external/gpl3/binutils/dist/bfd

2016-01-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 29 20:53:14 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-arm.c

Log Message:
we have our own popcount.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/binutils/dist/bfd/elf32-arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-arm.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.7 src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.8
--- src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.7	Fri Jan 29 09:42:43 2016
+++ src/external/gpl3/binutils/dist/bfd/elf32-arm.c	Fri Jan 29 15:53:14 2016
@@ -3133,6 +3133,7 @@ ctz (unsigned int mask)
 #endif
 }
 
+#ifndef __NetBSD__
 static inline int
 popcount (unsigned int mask)
 {
@@ -3150,6 +3151,7 @@ popcount (unsigned int mask)
   return sum;
 #endif
 }
+#endif
 
 /* Create an entry in an ARM ELF linker hash table.  */
 



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-01-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 29 20:54:10 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
fix aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.16 src/external/gpl3/binutils/dist/bfd/config.bfd:1.17
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.16	Fri Jan 29 13:05:18 2016
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Fri Jan 29 15:54:09 2016
@@ -191,26 +191,16 @@ case "${targ}" in
 targ_selvecs=aarch64_elf64_be_cloudabi_vec
 want64=true
 ;;
-  aarch64-*-linux*)
+  aarch64-*-linux* | aarch64-*-netbsd*)
 targ_defvec=aarch64_elf64_le_vec
 targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
 want64=true
 ;;
-  aarch64_be-*-linux*)
+  aarch64_be-*-linux* | aarch64_be-*-netbsd*)
 targ_defvec=aarch64_elf64_be_vec
 targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
 want64=true
 ;;
-  aarch64-*-netbsd*)
-targ_defvec=bfd_elf64_littleaarch64_vec
-targ_selvecs="bfd_elf64_bigaarch64_vec bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec"
-want64=true
-;;
-  aarch64_be-*-netbsd*)
-targ_defvec=bfd_elf64_bigaarch64_vec
-targ_selvecs="bfd_elf64_littleaarch64_vec bfd_elf32_bigarm_vec bfd_elf32_littlearm_vec"
-want64=true
-;;
   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
 targ_defvec=alpha_elf64_fbsd_vec
 targ_selvecs="alpha_elf64_vec alpha_ecoff_le_vec"



CVS commit: src/external/gpl3/binutils/dist/bfd

2015-05-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May 13 06:24:18 UTC 2015

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfn32-mips.c

Log Message:
Make sure mips_elf_n32_is_local_label_name is used.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/elfn32-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfn32-mips.c
diff -u src/external/gpl3/binutils/dist/bfd/elfn32-mips.c:1.4 src/external/gpl3/binutils/dist/bfd/elfn32-mips.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elfn32-mips.c:1.4	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/elfn32-mips.c	Wed May 13 06:24:18 2015
@@ -3377,6 +3377,9 @@ static const struct ecoff_debug_swap mip
 #define elf_backend_write_section	_bfd_mips_elf_write_section
 #define elf_backend_mips_irix_compat	elf_n32_mips_irix_compat
 #define elf_backend_mips_rtype_to_howto	mips_elf_n32_rtype_to_howto
+
+#define bfd_elf32_bfd_is_local_label_name \
+	mips_elf_n32_is_local_label_name
 #define bfd_elf32_bfd_is_target_special_symbol \
 	_bfd_mips_elf_is_target_special_symbol
 #define bfd_elf32_find_nearest_line	_bfd_mips_elf_find_nearest_line



CVS commit: src/external/gpl3/binutils/dist/bfd

2015-05-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat May  9 17:43:24 UTC 2015

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-arm.c

Log Message:
Fix TEXTREL message to print out the section name


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/bfd/elf32-arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-arm.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.5 src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.6
--- src/external/gpl3/binutils/dist/bfd/elf32-arm.c:1.5	Thu Jun 26 22:55:23 2014
+++ src/external/gpl3/binutils/dist/bfd/elf32-arm.c	Sat May  9 17:43:23 2015
@@ -13477,8 +13477,8 @@ elf32_arm_readonly_dynrelocs (struct elf
 
   if (info-warn_shared_textrel)
 (*_bfd_error_handler)
-  (_(warning: dynamic relocation in readonly section `%s'),
-  h-root.root.string);
+  (_(warning: dynamic relocation to `%s' in readonly section `%s'),
+  h-root.root.string, s-name);
 	  info-flags |= DF_TEXTREL;
 
 	  /* Not an error, just cut short the traversal.  */



CVS commit: src/external/gpl3/binutils/dist/bfd

2015-05-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri May  8 15:13:53 UTC 2015

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf64-mips.c

Log Message:
Define bfd_elf64_bfd_is_local_label_name so that local symbols really
get stripped, etc.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/elf64-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf64-mips.c
diff -u src/external/gpl3/binutils/dist/bfd/elf64-mips.c:1.4 src/external/gpl3/binutils/dist/bfd/elf64-mips.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elf64-mips.c:1.4	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/elf64-mips.c	Fri May  8 15:13:53 2015
@@ -4154,9 +4154,8 @@ const struct elf_size_info mips_elf64_si
 
 #define elf_backend_write_section	_bfd_mips_elf_write_section
 
-/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit
-   MIPS-specific function only applies to IRIX5, which had no 64-bit
-   ABI.  */
+#define bfd_elf64_bfd_is_local_label_name \
+	mips_elf64_is_local_label_name
 #define bfd_elf64_bfd_is_target_special_symbol \
 	_bfd_mips_elf_is_target_special_symbol
 #define bfd_elf64_find_nearest_line	_bfd_mips_elf_find_nearest_line



CVS commit: src/external/gpl3/binutils/dist/bfd

2015-03-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Mar 28 07:51:20 UTC 2015

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfnn-riscv.c

Log Message:
Deal with GNU IFUNCs properly.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c
diff -u src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c:1.1 src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c:1.2
--- src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c:1.1	Fri Mar 27 06:34:31 2015
+++ src/external/gpl3/binutils/dist/bfd/elfnn-riscv.c	Sat Mar 28 07:51:20 2015
@@ -860,6 +860,7 @@ riscv_elf_adjust_dynamic_symbol (struct 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
 	   (h-needs_plt
+		  || h-type == STT_GNU_IFUNC
 		  || h-u.weakdef != NULL
 		  || (h-def_dynamic
 		   h-ref_regular
@@ -868,7 +869,7 @@ riscv_elf_adjust_dynamic_symbol (struct 
   /* If this is a function, put it in the procedure linkage table.  We
  will fill in the contents of the procedure linkage table later
  (although we could actually do it here).  */
-  if (h-type == STT_FUNC || h-needs_plt)
+  if (h-type == STT_FUNC || h-type == STT_GNU_IFUNC || h-needs_plt)
 {
   if (h-plt.refcount = 0
 	  || SYMBOL_CALLS_LOCAL (info, h)



CVS commit: src/external/gpl3/binutils/dist/bfd

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 19:50:03 UTC 2015

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf64-ppc.c

Log Message:
Bring in 2 patches from binutils:

From Alan Modra: Wed, 3 Jul 2013 11:51:56 +0930: powerpc64 call stubs:
This brings powerpc64 ld in line with gold regarding calls allowed to
go via a plt call stub or toc-adjusting stub without a following nop.
A long time ago ld allowed tail calls, but this is wrong because we'll
return to the caller's caller with the wrong toc pointer.  I fixed
that for shared libraries but allowed tail calls in an executable for
some reason.  Probably just muddy thinking on my part, because there's
no difference between an executable and a shared library regarding the
need to restore the toc pointer.  Perhaps it was because some testcase
failed, most likely due to the g++ issue I comment on in the patch.

From Alan Modra: 29 Aug 2014 01:22:29 +: PowerPC64 call lacks nop error:
Enough people accidentally or otherwise use -mcmodel=small then wonder
why a call that is local is behaving as if it is going via the PLT.

* elf64-ppc.c (ppc64_elf_relocate_section): Report a different
error for calls via a toc adjusting stub without a nop.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf64-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.5 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.6
--- src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.5	Thu Mar  6 04:33:14 2014
+++ src/external/gpl3/binutils/dist/bfd/elf64-ppc.c	Fri Jan  2 14:50:02 2015
@@ -3618,9 +3618,6 @@ struct ppc_stub_hash_entry {
   struct ppc_link_hash_entry *h;
   struct plt_entry *plt_ent;
 
-  /* And the reloc addend that this was derived from.  */
-  bfd_vma addend;
-
   /* Where this stub is being called from, or, in the case of combined
  stub sections, the first input section in the group.  */
   asection *id_sec;
@@ -11669,7 +11666,6 @@ ppc64_elf_size_stubs (struct bfd_link_in
 		}
 		  stub_entry-h = hash;
 		  stub_entry-plt_ent = plt_ent;
-		  stub_entry-addend = irela-r_addend;
 
 		  if (stub_entry-h != NULL)
 		htab-stub_globals += 1;
@@ -12910,60 +12906,96 @@ ppc64_elf_relocate_section (bfd *output_
 	{
 	  bfd_boolean can_plt_call = FALSE;
 
+	  /* All of these stubs will modify r2, so there must be a
+		 branch and link followed by a nop.  The nop is
+		 replaced by an insn to restore r2.  */
 	  if (rel-r_offset + 8 = input_section-size)
 		{
-		  unsigned long nop;
-		  nop = bfd_get_32 (input_bfd, contents + rel-r_offset + 4);
-		  if (nop == NOP
-		  || nop == CROR_151515 || nop == CROR_313131)
-		{
-		  if (h != NULL
-			   (h == htab-tls_get_addr_fd
-			  || h == htab-tls_get_addr)
-			   !htab-no_tls_get_addr_opt)
+		  unsigned long br;
+
+		  br = bfd_get_32 (input_bfd,
+   contents + rel-r_offset);
+		  if ((br  1) != 0)
+		{
+		  unsigned long nop;
+
+		  nop = bfd_get_32 (input_bfd,
+	contents + rel-r_offset + 4);
+		  if (nop == NOP
+			  || nop == CROR_151515 || nop == CROR_313131)
 			{
-			  /* Special stub used, leave nop alone.  */
+			  if (h != NULL
+			   (h == htab-tls_get_addr_fd
+  || h == htab-tls_get_addr)
+			   !htab-no_tls_get_addr_opt)
+			{
+			  /* Special stub used, leave nop alone.  */
+			}
+			  else
+			bfd_put_32 (input_bfd, LD_R2_40R1,
+	contents + rel-r_offset + 4);
+			  can_plt_call = TRUE;
 			}
-		  else
-			bfd_put_32 (input_bfd, LD_R2_40R1,
-contents + rel-r_offset + 4);
-		  can_plt_call = TRUE;
 		}
 		}
 
-	  if (!can_plt_call)
+	  if (!can_plt_call  h != NULL)
 		{
-		  if (stub_entry-stub_type == ppc_stub_plt_call
-		  || stub_entry-stub_type == ppc_stub_plt_call_r2save)
-		{
-		  /* If this is a plain branch rather than a branch
-			 and link, don't require a nop.  However, don't
-			 allow tail calls in a shared library as they
-			 will result in r2 being corrupted.  */
-		  unsigned long br;
-		  br = bfd_get_32 (input_bfd, contents + rel-r_offset);
-		  if (info-executable  (br  1) == 0)
-			can_plt_call = TRUE;
-		  else
-			stub_entry = NULL;
-		}
-		  else if (h != NULL
-			strcmp (h-elf.root.root.string,
-  .__libc_start_main) == 0)
+		  const char *name = h-elf.root.root.string;
+
+		  if (*name == '.')
+		++name;
+
+		  if (strncmp (name, __libc_start_main, 17) == 0
+		   (name[17] == 0 || name[17] == '@'))
 		{
-		  /* Allow crt1 branch to go via a toc adjusting stub.  */
+		  /* Allow crt1 branch to go via a toc adjusting
+			 stub.  Other calls that never return could do
+		

CVS commit: src/external/gpl3/binutils/dist/bfd

2014-08-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 26 16:39:49 UTC 2014

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-mips.c

Log Message:
Allow STT_GNU_IFUNC to be a dynamic symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/binutils/dist/bfd/elfxx-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-mips.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.7 src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.8
--- src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.7	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/elfxx-mips.c	Tue Aug 26 16:39:49 2014
@@ -8626,6 +8626,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (str
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
 	   (h-needs_plt
+		  || h-type == STT_GNU_IFUNC
 		  || h-u.weakdef != NULL
 		  || (h-def_dynamic
 		   h-ref_regular



CVS commit: src/external/gpl3/binutils/dist/bfd

2014-08-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 26 17:03:51 UTC 2014

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-m68k.c elf32-sh.c
elf32-vax.c

Log Message:
Allow STT_GNU_IFUNC to be dynamic symbols


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c \
src/external/gpl3/binutils/dist/bfd/elf32-sh.c
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/binutils/dist/bfd/elf32-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-m68k.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.4 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.4	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/elf32-m68k.c	Tue Aug 26 17:03:51 2014
@@ -3104,6 +3104,7 @@ elf_m68k_adjust_dynamic_symbol (struct b
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
 	   (h-needs_plt
+		  || h-type == STT_GNU_IFUNC
 		  || h-u.weakdef != NULL
 		  || (h-def_dynamic
 		   h-ref_regular
@@ -3112,7 +3113,7 @@ elf_m68k_adjust_dynamic_symbol (struct b
   /* If this is a function, put it in the procedure linkage table.  We
  will fill in the contents of the procedure linkage table later,
  when we know the address of the .got section.  */
-  if (h-type == STT_FUNC
+  if ((h-type == STT_FUNC || h-type == STT_GNU_IFUNC)
   || h-needs_plt)
 {
   if ((h-plt.refcount = 0
Index: src/external/gpl3/binutils/dist/bfd/elf32-sh.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-sh.c:1.4 src/external/gpl3/binutils/dist/bfd/elf32-sh.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elf32-sh.c:1.4	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/elf32-sh.c	Tue Aug 26 17:03:51 2014
@@ -2808,6 +2808,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (htab-root.dynobj != NULL
 	   (h-needs_plt
+		  || h-type == STT_GNU_IFUNC
 		  || h-u.weakdef != NULL
 		  || (h-def_dynamic
 		   h-ref_regular
@@ -2816,7 +2817,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd
   /* If this is a function, put it in the procedure linkage table.  We
  will fill in the contents of the procedure linkage table later,
  when we know the address of the .got section.  */
-  if (h-type == STT_FUNC
+  if ((h-type == STT_FUNC || h-type == STT_GNU_IFUNC)
   || h-needs_plt)
 {
   if (h-plt.refcount = 0

Index: src/external/gpl3/binutils/dist/bfd/elf32-vax.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.9 src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.10
--- src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.9	Thu Oct  3 12:06:04 2013
+++ src/external/gpl3/binutils/dist/bfd/elf32-vax.c	Tue Aug 26 17:03:51 2014
@@ -946,6 +946,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
 	   (h-needs_plt
+		  || h-type == STT_GNU_IFUNC
 		  || h-u.weakdef != NULL
 		  || (h-def_dynamic
 		   h-ref_regular
@@ -954,7 +955,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
   /* If this is a function, put it in the procedure linkage table.  We
  will fill in the contents of the procedure linkage table later,
  when we know the address of the .got section.  */
-  if (h-type == STT_FUNC
+  if ((h-type == STT_FUNC || h-type == STT_GNU_IFUNC)
   || h-needs_plt)
 {
   if (h-plt.refcount = 0



CVS commit: src/external/gpl3/binutils/dist/bfd

2014-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Aug 11 20:53:16 UTC 2014

Modified Files:
src/external/gpl3/binutils/dist/bfd: ChangeLog elflink.c

Log Message:
Apply change from upstream to fix PR/48709 - port-alpha/48709: static
threaded programs crash.

With this fix the new weak symbol's st_other is not merged in, i.e. NOPV
is not copied from the libc __libc_thr_init.

* elflink.c (_bfd_elf_merge_symbol): If merging a new weak
symbol that will be skipped, we don't have a new definition.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/bfd/ChangeLog
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/binutils/dist/bfd/elflink.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/ChangeLog
diff -u src/external/gpl3/binutils/dist/bfd/ChangeLog:1.5 src/external/gpl3/binutils/dist/bfd/ChangeLog:1.6
--- src/external/gpl3/binutils/dist/bfd/ChangeLog:1.5	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/ChangeLog	Mon Aug 11 20:53:16 2014
@@ -1,3 +1,8 @@
+2013-12-14  Alan Modra  amo...@gmail.com
+
+	* elflink.c (_bfd_elf_merge_symbol): If merging a new weak
+	symbol that will be skipped, we don't have a new definition.
+
 2013-03-25  Tristan Gingold  ging...@adacore.com
 
 	* configure.in: Bump version to 2.23.2

Index: src/external/gpl3/binutils/dist/bfd/elflink.c
diff -u src/external/gpl3/binutils/dist/bfd/elflink.c:1.7 src/external/gpl3/binutils/dist/bfd/elflink.c:1.8
--- src/external/gpl3/binutils/dist/bfd/elflink.c:1.7	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/elflink.c	Mon Aug 11 20:53:16 2014
@@ -1442,7 +1442,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
   if (!(oldbfd != NULL
 	 (oldbfd-flags  BFD_PLUGIN) != 0
 	 (abfd-flags  BFD_PLUGIN) == 0))
-	*skip = TRUE;
+	{
+	  newdef = FALSE;
+	  *skip = TRUE;
+	}
 
   /* Merge st_other.  If the symbol already has a dynamic index,
 	 but visibility says it should not be visible, turn it into a



CVS commit: src/external/gpl3/binutils/dist/bfd

2014-03-10 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon Mar 10 12:01:19 UTC 2014

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
Enable 64-bit integer handling for gas even on 32-bit host since
sparc64 kernel now uses 64-bit constant with %hh operator.

Fix for PR toolchain/48630.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.10 src/external/gpl3/binutils/dist/bfd/config.bfd:1.11
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.10	Tue Dec 24 15:06:39 2013
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Mon Mar 10 12:01:19 2014
@@ -1460,6 +1460,7 @@ case ${targ} in
   sparc-*-netbsdelf*)
 targ_defvec=bfd_elf32_sparc_vec
 targ_selvecs=sparcnetbsd_vec sunos_big_vec
+want64=true
 ;;
   sparc-*-netbsd*)
 targ_defvec=sparcnetbsd_vec



CVS commit: src/external/gpl3/binutils/dist/bfd

2014-03-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar  6 09:33:14 UTC 2014

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf64-ppc.c

Log Message:
If marking a shared image TEXTREL, print out a warning about the section
that caused it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf64-ppc.c
diff -u src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.4 src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elf64-ppc.c:1.4	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/elf64-ppc.c	Thu Mar  6 09:33:14 2014
@@ -9196,7 +9196,13 @@ ppc64_elf_size_dynamic_sections (bfd *ou
 		srel = htab-reliplt;
 		  srel-size += p-count * sizeof (Elf64_External_Rela);
 		  if ((p-sec-output_section-flags  SEC_READONLY) != 0)
-		info-flags |= DF_TEXTREL;
+		{
+		  if (info-warn_shared_textrel)
+			(*_bfd_error_handler)
+			  (_(warning: dynamic relocation in readonly section `%s'),
+			  p-sec-output_section-name);
+		  info-flags |= DF_TEXTREL;
+		}
 		}
 	}
 	}



CVS commit: src/external/gpl3/binutils/dist/bfd

2013-12-24 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Dec 24 15:06:40 UTC 2013

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
Enable 32/64-bit PE-COFF targets for NetBSD/i386 in libbfd.
Needed to build UEFI things for IA32 using native toolchain.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.9 src/external/gpl3/binutils/dist/bfd/config.bfd:1.10
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.9	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Tue Dec 24 15:06:39 2013
@@ -575,8 +575,8 @@ case ${targ} in
 ;;
   i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu)
 targ_defvec=bfd_elf32_i386_vec
-targ_selvecs=i386netbsd_vec
-targ64_selvecs=bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec
+targ_selvecs=i386netbsd_vec i386coff_vec i386pei_vec
+targ64_selvecs=bfd_elf64_x86_64_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec
 ;;
   i[3-7]86-*-netbsdpe*)
 targ_defvec=i386pe_vec



CVS commit: src/external/gpl3/binutils/dist/bfd

2013-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct  4 18:08:02 UTC 2013

Modified Files:
src/external/gpl3/binutils/dist/bfd: aoutx.h

Log Message:
Allow bfd_mach_arm4 machines to produce a.out binaries.
Perhaps we should just let every arm machine produce them?
Or we should use M_ARM6_NETBSD midmag for those?


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/aoutx.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/aoutx.h
diff -u src/external/gpl3/binutils/dist/bfd/aoutx.h:1.4 src/external/gpl3/binutils/dist/bfd/aoutx.h:1.5
--- src/external/gpl3/binutils/dist/bfd/aoutx.h:1.4	Sun Sep 29 10:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/aoutx.h	Fri Oct  4 14:08:02 2013
@@ -762,7 +762,7 @@ NAME (aout, machine_type) (enum bfd_arch
   break;
 
 case bfd_arch_arm:
-  if (machine == 0)
+  if (machine == 0 || machine == 5)
 	arch_flags = M_ARM;
   break;
 



CVS commit: src/external/gpl3/binutils/dist/bfd

2013-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct  3 12:06:04 UTC 2013

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-vax.c

Log Message:
Apply rev 1.5 again, from Matt Thomas:
Fix problem leading to triggering a BFD assert: when allocating space in the
got, do not allocate slots for symbols without default visibility.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/binutils/dist/bfd/elf32-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-vax.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.8 src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.9
--- src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.8	Sun Sep 29 14:03:29 2013
+++ src/external/gpl3/binutils/dist/bfd/elf32-vax.c	Thu Oct  3 12:06:04 2013
@@ -1314,6 +1314,7 @@ elf_vax_instantiate_got_entries (struct 
 
   if (!elf_hash_table (info)-dynamic_sections_created
   || (info-shared  info-symbolic)
+  || ELF_ST_VISIBILITY (h-other) != STV_DEFAULT
   || h-forced_local)
 {
   h-got.refcount = 0;
@@ -1334,9 +1335,7 @@ elf_vax_instantiate_got_entries (struct 
 
   dyn = elf_hash_table (info)-dynamic_sections_created;
   /* Allocate space in the .got and .rela.got sections.  */
-  if (ELF_ST_VISIBILITY (h-other) == STV_DEFAULT
-	   (info-shared
-	  || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
+  if (info-shared || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
 	{
 	  sgot-size += 4;
 	  srelgot-size += sizeof (Elf32_External_Rela);



CVS commit: src/external/gpl3/binutils/dist/bfd

2013-08-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Aug 12 05:14:24 UTC 2013

Modified Files:
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
Match arm*-*-netbsdelf*-*


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/binutils/dist/bfd/config.bfd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.7 src/external/gpl3/binutils/dist/bfd/config.bfd:1.8
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.7	Fri Jul 19 16:01:33 2013
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Mon Aug 12 05:14:24 2013
@@ -217,11 +217,11 @@ case ${targ} in
 targ_selvecs=bfd_elf32_bigarc_vec
 ;;
 
-  armeb-*-netbsdelf*)
+  arm*eb-*-netbsdelf*)
 targ_defvec=bfd_elf32_bigarm_vec
 targ_selvecs=bfd_elf32_littlearm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec
 ;;
-  arm-*-netbsdelf*)
+  arm*-*-netbsdelf*)
 targ_defvec=bfd_elf32_littlearm_vec
 targ_selvecs=bfd_elf32_bigarm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec
 ;;



CVS commit: src/external/gpl3/binutils/dist/bfd

2012-08-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Aug 27 16:50:14 UTC 2012

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-vax.c

Log Message:
Make this to produce working shared libraries again.
Resultant distribution was booted into single user using shared libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/binutils/dist/bfd/elf32-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-vax.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.6 src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.7
--- src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.6	Tue Jul 17 21:37:21 2012
+++ src/external/gpl3/binutils/dist/bfd/elf32-vax.c	Mon Aug 27 16:50:14 2012
@@ -52,7 +52,7 @@ static bfd_vma elf_vax_plt_sym_val (bfd_
 
 static bfd_boolean elf32_vax_set_private_flags (bfd *, flagword);
 static bfd_boolean elf32_vax_merge_private_bfd_data (bfd *, bfd *);
-static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, PTR);
+static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, void *);
 
 static reloc_howto_type howto_table[] = {
   HOWTO (R_VAX_NONE,		/* type */
@@ -422,7 +422,7 @@ static bfd_boolean elf_vax_instantiate_g
 #define elf_vax_link_hash_traverse(table, func, info)			\
   (elf_link_hash_traverse		\
((table),\
-(bfd_boolean (*) (struct elf_link_hash_entry *, PTR)) (func),	\
+(bfd_boolean (*) (struct elf_link_hash_entry *, void *)) (func),	\
 (info)))
 
 /* Create an entry in an VAX ELF linker hash table.  */
@@ -531,7 +531,7 @@ elf32_vax_merge_private_bfd_data (bfd *i
 
 /* Display the flags field */
 static bfd_boolean
-elf32_vax_print_private_bfd_data (bfd *abfd, PTR ptr)
+elf32_vax_print_private_bfd_data (bfd *abfd, void * ptr)
 {
   FILE *file = (FILE *) ptr;
 
@@ -640,14 +640,13 @@ elf_vax_check_relocs (bfd *abfd, struct 
 	  srelgot = bfd_get_section_by_name (dynobj, .rela.got);
 	  if (srelgot == NULL)
 		{
+		  flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+| SEC_IN_MEMORY | SEC_LINKER_CREATED
+| SEC_READONLY);
+
 		  srelgot = bfd_make_section_with_flags (dynobj,
 			 .rela.got,
-			 (SEC_ALLOC
-			  | SEC_LOAD
-			  | SEC_HAS_CONTENTS
-			  | SEC_IN_MEMORY
-			  | SEC_LINKER_CREATED
-			  | SEC_READONLY));
+			 flags);
 		  if (srelgot == NULL
 		  || !bfd_set_section_alignment (dynobj, srelgot, 2))
 		return FALSE;
@@ -769,30 +768,14 @@ elf_vax_check_relocs (bfd *abfd, struct 
 		  if (sreloc == NULL)
 		return FALSE;
 
-#if 0
-		  BFD_ASSERT (CONST_STRNEQ (name, .rela)
-			   strcmp (bfd_get_section_name (abfd, sec),
-	 name + 5) == 0);
-
-		  sreloc = bfd_get_section_by_name (dynobj, name);
-		  if (sreloc == NULL)
+		  if (sec-flags  SEC_READONLY)
 		{
-		  sreloc = bfd_make_section_with_flags (dynobj,
-			name,
-			(SEC_ALLOC
-			 | SEC_LOAD
-			 | SEC_HAS_CONTENTS
-			 | SEC_IN_MEMORY
-			 | SEC_LINKER_CREATED
-			 | SEC_READONLY));
-		  if (sreloc == NULL
-			  || !bfd_set_section_alignment (dynobj, sreloc, 2))
-			return FALSE;
+			if (info-warn_shared_textrel)
+			  (*_bfd_error_handler)
+			(_(warning: dynamic relocation in readonly section `%s'),
+			 sec-name);
+			info-flags |= DF_TEXTREL;
 		}
-#endif
-
-		  if (sec-flags  SEC_READONLY)
-		info-flags |= DF_TEXTREL;
 		}
 
 	  sreloc-size += sizeof (Elf32_External_Rela);
@@ -973,14 +956,14 @@ elf_vax_adjust_dynamic_symbol (info, h)
   if (h-type == STT_FUNC
   || h-needs_plt)
 {
-  if (h-plt.refcount == 0
-	  || SYMBOL_CALLS_LOCAL (info, 0)
+  if (h-plt.refcount = 0
+	  || SYMBOL_CALLS_LOCAL (info, h)
 	  || (ELF_ST_VISIBILITY (h-other) != STV_DEFAULT
 	   h-root.type == bfd_link_hash_undefweak))
 	{
 	  /* This case can occur if we saw a PLTxx reloc in an input
 	 file, but the symbol was never referred to by a dynamic
-	 object, or if all references were garbage collected..  In
+	 object, or if all references were garbage collected.  In
 	 such a case, we don't actually need to build a procedure
 	 linkage table, and we can just do a PCxx reloc instead.  */
 	  h-plt.offset = (bfd_vma) -1;
@@ -1057,13 +1040,6 @@ elf_vax_adjust_dynamic_symbol (info, h)
   if (info-shared)
 return TRUE;
 
-  if (h-size == 0)
-{
-  (*_bfd_error_handler) (_(dynamic variable `%s' is zero size),
-			 h-root.root.string);
-  return TRUE;
-}
-
   /* We must allocate the symbol in our .dynbss section, which will
  become part of the .bss section of the executable.  There will be
  an entry for this symbol in the .dynsym section.  The dynamic
@@ -1081,7 +1057,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
  copy the initial value out of the dynamic object and into the
  

CVS commit: src/external/gpl3/binutils/dist/bfd

2012-07-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 17 21:37:21 UTC 2012

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-vax.c

Log Message:
Two fixes.  Better PLT pruning (don't emit PLTs for local functions).
If emitting a reloc against a readonly section in a shared image,
cause TEXTREL to be set.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/bfd/elf32-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-vax.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.5 src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.6
--- src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.5	Fri Feb 10 01:47:37 2012
+++ src/external/gpl3/binutils/dist/bfd/elf32-vax.c	Tue Jul 17 21:37:21 2012
@@ -973,39 +973,21 @@ elf_vax_adjust_dynamic_symbol (info, h)
   if (h-type == STT_FUNC
   || h-needs_plt)
 {
-  if (! info-shared
-	   !h-def_dynamic
-	   !h-ref_dynamic
-	  /* We must always create the plt entry if it was referenced
-	 by a PLTxxO relocation.  In this case we already recorded
-	 it as a dynamic symbol.  */
-	   h-dynindx == -1)
+  if (h-plt.refcount == 0
+	  || SYMBOL_CALLS_LOCAL (info, 0)
+	  || (ELF_ST_VISIBILITY (h-other) != STV_DEFAULT
+	   h-root.type == bfd_link_hash_undefweak))
 	{
 	  /* This case can occur if we saw a PLTxx reloc in an input
 	 file, but the symbol was never referred to by a dynamic
-	 object.  In such a case, we don't actually need to build
-	 a procedure linkage table, and we can just do a PCxx
-	 reloc instead.  */
-	  BFD_ASSERT (h-needs_plt);
+	 object, or if all references were garbage collected..  In
+	 such a case, we don't actually need to build a procedure
+	 linkage table, and we can just do a PCxx reloc instead.  */
 	  h-plt.offset = (bfd_vma) -1;
-	  return TRUE;
-	}
-
-  /* GC may have rendered this entry unused.  */
-  if (h-plt.refcount = 0)
-	{
 	  h-needs_plt = 0;
-	  h-plt.offset = (bfd_vma) -1;
 	  return TRUE;
 	}
 
-  /* Make sure this symbol is output as a dynamic symbol.  */
-  if (h-dynindx == -1)
-	{
-	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
-	return FALSE;
-	}
-
   s = bfd_get_section_by_name (dynobj, .plt);
   BFD_ASSERT (s != NULL);
 
@@ -1751,14 +1733,15 @@ elf_vax_relocate_section (bfd *output_bf
 		}
 		}
 
-	  if (strcmp (bfd_get_section_name (input_bfd, input_section),
-			   .text) == 0 ||
-		  (info-shared
-		ELF32_R_TYPE(outrel.r_info) != R_VAX_32
-		ELF32_R_TYPE(outrel.r_info) != R_VAX_RELATIVE
-		ELF32_R_TYPE(outrel.r_info) != R_VAX_COPY
-		ELF32_R_TYPE(outrel.r_info) != R_VAX_JMP_SLOT
-		ELF32_R_TYPE(outrel.r_info) != R_VAX_GLOB_DAT))
+	  if (input_section-flags  SEC_READONLY)
+		 info-flags |= DF_TEXTREL;
+
+	  if (input_section-flags  SEC_READONLY
+		  || (ELF32_R_TYPE(outrel.r_info) != R_VAX_32
+		   ELF32_R_TYPE(outrel.r_info) != R_VAX_RELATIVE
+		   ELF32_R_TYPE(outrel.r_info) != R_VAX_COPY
+		   ELF32_R_TYPE(outrel.r_info) != R_VAX_JMP_SLOT
+		   ELF32_R_TYPE(outrel.r_info) != R_VAX_GLOB_DAT))
 		{
 		  if (h != NULL)
 		(*_bfd_error_handler)



CVS commit: src/external/gpl3/binutils/dist/bfd

2012-03-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Mar  4 17:09:33 UTC 2012

Modified Files:
src/external/gpl3/binutils/dist/bfd: elflink.c

Log Message:
Fix merge botch dealing with linker assignments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/bfd/elflink.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elflink.c
diff -u src/external/gpl3/binutils/dist/bfd/elflink.c:1.5 src/external/gpl3/binutils/dist/bfd/elflink.c:1.6
--- src/external/gpl3/binutils/dist/bfd/elflink.c:1.5	Sat Nov 26 15:59:34 2011
+++ src/external/gpl3/binutils/dist/bfd/elflink.c	Sun Mar  4 17:09:32 2012
@@ -567,10 +567,7 @@ bfd_elf_record_link_assignment (bfd *out
!h-def_regular)
 h-verinfo.verdef = NULL;
 
-  /* Only set symbols not provided from the linker script as regular so
- that we can find their version from verdef not vertree */
-  if (!provide)
-h-def_regular = 1;
+  h-def_regular = 1;
 
   if (provide  hidden)
 {



CVS commit: src/external/gpl3/binutils/dist/bfd

2012-03-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Mar  2 16:37:16 UTC 2012

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-mips.c

Log Message:
Fix support for .protected symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/bfd/elfxx-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-mips.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.5 src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.6
--- src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.5	Sun Sep 25 04:32:35 2011
+++ src/external/gpl3/binutils/dist/bfd/elfxx-mips.c	Fri Mar  2 16:37:16 2012
@@ -5138,7 +5138,10 @@ mips_elf_calculate_relocation (bfd *abfd
 			   || ((r_type == R_MIPS_26 || r_type == R_MIPS_JALR)
 			target_is_16_bit_code_p));
 
-  local_p = h == NULL || SYMBOL_REFERENCES_LOCAL (info, h-root);
+  local_p = h == NULL
+|| (h-got_only_for_calls
+	? SYMBOL_CALLS_LOCAL (info, h-root)
+	: SYMBOL_REFERENCES_LOCAL (info, h-root));
 
   gp0 = _bfd_get_gp_value (input_bfd);
   gp = _bfd_get_gp_value (abfd);



CVS commit: src/external/gpl3/binutils/dist/bfd

2012-02-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 10 01:47:38 UTC 2012

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-vax.c

Log Message:
Fix problem leading to triggering a BFD assert: when allocating space in the
got, do not allocate slots for symbols without default visibility.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/elf32-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-vax.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.4 src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.4	Sun Sep 25 11:07:32 2011
+++ src/external/gpl3/binutils/dist/bfd/elf32-vax.c	Fri Feb 10 01:47:37 2012
@@ -1358,6 +1358,7 @@ elf_vax_instantiate_got_entries (struct 
 
   if (!elf_hash_table (info)-dynamic_sections_created
   || (info-shared  info-symbolic)
+  || ELF_ST_VISIBILITY (h-other) != STV_DEFAULT
   || h-forced_local)
 {
   h-got.refcount = 0;
@@ -1378,9 +1379,7 @@ elf_vax_instantiate_got_entries (struct 
 
   dyn = elf_hash_table (info)-dynamic_sections_created;
   /* Allocate space in the .got and .rela.got sections.  */
-  if (ELF_ST_VISIBILITY (h-other) == STV_DEFAULT
-	   (info-shared
-	  || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
+  if (info-shared || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
 	{
 	  sgot-size += 4;
 	  srelgot-size += sizeof (Elf32_External_Rela);



CVS commit: src/external/gpl3/binutils/dist/bfd

2011-12-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 12 07:40:56 UTC 2011

Modified Files:
src/external/gpl3/binutils/dist/bfd: ChangeLog elf32-hppa.c

Log Message:
Revert last change to elf32-hppa.c and pull across the fix to my binutils
PR 13476.

tests/lib/libc/tls on hppa still passes with this change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/binutils/dist/bfd/ChangeLog
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/elf32-hppa.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/ChangeLog
diff -u src/external/gpl3/binutils/dist/bfd/ChangeLog:1.3 src/external/gpl3/binutils/dist/bfd/ChangeLog:1.4
--- src/external/gpl3/binutils/dist/bfd/ChangeLog:1.3	Sun Sep 25 04:32:34 2011
+++ src/external/gpl3/binutils/dist/bfd/ChangeLog	Mon Dec 12 07:40:56 2011
@@ -1,3 +1,13 @@
+2011-12-11  John Davis Anglin  dave.ang...@nrc-cnrc.gc.ca
+
+	PR binutils/13476
+	* elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
+	R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations to
+	R_PARISC_DPREL21L when not doing a shared link.  Likewise convert
+	R_PARISC_TLS_GD14R, R_PARISC_TLS_LDM14R and R_PARISC_TLS_IE14R to
+	R_PARISC_DPREL14R.  Handle R_PARISC_TLS_GD21L, R_PARISC_TLS_LDM21L
+	and R_PARISC_TLS_IE21L with R_PARISC_DLTIND21L.
+
 2011-06-27  Tristan Gingold  ging...@adacore.com
 
 	* configure.in: Bump version to 2.21.1

Index: src/external/gpl3/binutils/dist/bfd/elf32-hppa.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-hppa.c:1.4 src/external/gpl3/binutils/dist/bfd/elf32-hppa.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elf32-hppa.c:1.4	Fri Dec  2 09:40:18 2011
+++ src/external/gpl3/binutils/dist/bfd/elf32-hppa.c	Mon Dec 12 07:40:56 2011
@@ -3356,10 +3356,16 @@ final_link_relocate (asection *input_sec
   switch (r_type)
 	{
 	  case R_PARISC_DLTIND21L:
+	  case R_PARISC_TLS_GD21L:
+	  case R_PARISC_TLS_LDM21L:
+	  case R_PARISC_TLS_IE21L:
 	r_type = R_PARISC_DPREL21L;
 	break;
 
 	  case R_PARISC_DLTIND14R:
+	  case R_PARISC_TLS_GD14R:
+	  case R_PARISC_TLS_LDM14R:
+	  case R_PARISC_TLS_IE14R:
 	r_type = R_PARISC_DPREL14R;
 	break;
 
@@ -3430,41 +3436,43 @@ final_link_relocate (asection *input_sec
 	 most efficient way of using PIC code in an incomplete executable,
 	 but the user must follow the standard runtime conventions for
 	 accessing data for this to work.  */
-  if (orig_r_type == R_PARISC_DLTIND21L)
+  if (orig_r_type != r_type)
 	{
-	  /* Convert addil instructions if the original reloc was a
-	 DLTIND21L.  GCC sometimes uses a register other than r19 for
-	 the operation, so we must convert any addil instruction
-	 that uses this relocation.  */
-	  if ((insn  0xfc00) == ((int) OP_ADDIL  26))
-	insn = ADDIL_DP;
-	  else
-	/* We must have a ldil instruction.  It's too hard to find
-	   and convert the associated add instruction, so issue an
-	   error.  */
-	(*_bfd_error_handler)
-	  (_(%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link),
-	   input_bfd,
-	   input_section,
-	   (long) offset,
-	   howto-name,
-	   insn);
-	}
-  else if (orig_r_type == R_PARISC_DLTIND14F)
-	{
-	  /* This must be a format 1 load/store.  Change the base
-	 register to dp.  */
-	  insn = (insn  0xfc1) | (27  21);
-	}
-
-/* For all the DP relative relocations, we need to examine the symbol's
-   section.  If it has no section or if it's a code section, then
-   data pointer relative makes no sense.  In that case we don't
-   adjust the value, and for 21 bit addil instructions, we change the
-   source addend register from %dp to %r0.  This situation commonly
-   arises for undefined weak symbols and when a variable's constness
-   is declared differently from the way the variable is defined.  For
-   instance: extern int foo with foo defined as const int foo.  */
+	  if (r_type == R_PARISC_DPREL21L)
+	{
+	  /* GCC sometimes uses a register other than r19 for the
+		 operation, so we must convert any addil instruction
+		 that uses this relocation.  */
+	  if ((insn  0xfc00) == ((int) OP_ADDIL  26))
+		insn = ADDIL_DP;
+	  else
+		/* We must have a ldil instruction.  It's too hard to find
+		   and convert the associated add instruction, so issue an
+		   error.  */
+		(*_bfd_error_handler)
+		  (_(%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link),
+		   input_bfd,
+		   input_section,
+		   (long) offset,
+		   howto-name,
+		   insn);
+	}
+	  else if (r_type == R_PARISC_DPREL14F)
+	{
+	  /* This must be a format 1 load/store.  Change the base
+		 register to dp.  */
+	  insn = (insn  0xfc1) | (27  21);
+	}
+	}
+
+  /* For all the DP relative relocations, we need to examine the symbol's
+	 

CVS commit: src/external/gpl3/binutils/dist/bfd

2011-11-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Nov 26 15:59:34 UTC 2011

Modified Files:
src/external/gpl3/binutils/dist/bfd: elflink.c

Log Message:
Only set symbols not provided from the linker script as regular so
that we can find their version from verdef not vertree. This bug
showed up on the hp700 build of heimdal's libkrb5, where we got
the end symbol with a bad version from libhx509. The hp700 linker
script defines that end symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/elflink.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elflink.c
diff -u src/external/gpl3/binutils/dist/bfd/elflink.c:1.4 src/external/gpl3/binutils/dist/bfd/elflink.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elflink.c:1.4	Sun Sep 25 00:32:35 2011
+++ src/external/gpl3/binutils/dist/bfd/elflink.c	Sat Nov 26 10:59:34 2011
@@ -567,7 +567,10 @@ bfd_elf_record_link_assignment (bfd *out
!h-def_regular)
 h-verinfo.verdef = NULL;
 
-  h-def_regular = 1;
+  /* Only set symbols not provided from the linker script as regular so
+ that we can find their version from verdef not vertree */
+  if (!provide)
+h-def_regular = 1;
 
   if (provide  hidden)
 {



CVS commit: src/external/gpl3/binutils/dist/bfd

2011-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct  7 23:24:14 UTC 2011

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-sparc.c

Log Message:
gnu style.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.4 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.5
--- src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.4	Fri Oct  7 18:30:56 2011
+++ src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c	Fri Oct  7 19:24:14 2011
@@ -3392,11 +3392,10 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 		memset (outrel, 0, sizeof outrel);
 	  /* h-dynindx may be -1 if the symbol was marked to
 		 become local.  */
-	  else if (h != NULL 
-		   h-dynindx != -1  ! is_plt 
-		   (!info-shared
-			|| !SYMBOLIC_BIND (info, h)
-			|| !h-def_regular))
+	  else if (h != NULL  h-dynindx != -1  ! is_plt
+		(!info-shared
+			   || !SYMBOLIC_BIND (info, h)
+			   || !h-def_regular))
 		{
 		  BFD_ASSERT (h-dynindx != -1);
 		  outrel.r_info = SPARC_ELF_R_INFO (htab, rel, h-dynindx, r_type);



CVS commit: src/external/gpl3/binutils/dist/bfd

2011-09-25 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Sep 25 11:07:32 UTC 2011

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-vax.c

Log Message:
make this build again.

gimpy, please check the #if 0'd code that may or may not be useful? :)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/binutils/dist/bfd/elf32-vax.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-vax.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.3 src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.4
--- src/external/gpl3/binutils/dist/bfd/elf32-vax.c:1.3	Sun Sep 25 04:32:35 2011
+++ src/external/gpl3/binutils/dist/bfd/elf32-vax.c	Sun Sep 25 11:07:32 2011
@@ -769,6 +769,7 @@ elf_vax_check_relocs (bfd *abfd, struct 
 		  if (sreloc == NULL)
 		return FALSE;
 
+#if 0
 		  BFD_ASSERT (CONST_STRNEQ (name, .rela)
 			   strcmp (bfd_get_section_name (abfd, sec),
 	 name + 5) == 0);
@@ -788,6 +789,7 @@ elf_vax_check_relocs (bfd *abfd, struct 
 			  || !bfd_set_section_alignment (dynobj, sreloc, 2))
 			return FALSE;
 		}
+#endif
 
 		  if (sec-flags  SEC_READONLY)
 		info-flags |= DF_TEXTREL;
@@ -1644,7 +1646,6 @@ elf_vax_relocate_section (bfd *output_bf
 
 	case R_VAX_PC8:
 	case R_VAX_PC16:
-	case R_VAX_PC32:
 	r_vax_pc32_shared:
 	  if (h == NULL
 	  || ELF_ST_VISIBILITY (h-other) != STV_DEFAULT



CVS commit: src/external/gpl3/binutils/dist/bfd

2010-02-23 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Feb 23 20:42:40 UTC 2010

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-i386.c

Log Message:
adjust INTERP path for NetBSD (needed eg for -static -pie)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/binutils/dist/bfd/elf32-i386.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-i386.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-i386.c:1.2 src/external/gpl3/binutils/dist/bfd/elf32-i386.c:1.3
--- src/external/gpl3/binutils/dist/bfd/elf32-i386.c:1.2	Wed Aug 19 07:19:30 2009
+++ src/external/gpl3/binutils/dist/bfd/elf32-i386.c	Tue Feb 23 20:42:40 2010
@@ -504,7 +504,7 @@
 /* The name of the dynamic interpreter.  This is put in the .interp
section.  */
 
-#define ELF_DYNAMIC_INTERPRETER /usr/lib/libc.so.1
+#define ELF_DYNAMIC_INTERPRETER /libexec/ld.elf_so
 
 /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
copying dynamic variables from a shared lib into an app's dynbss



CVS commit: src/external/gpl3/binutils/dist/bfd

2010-01-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 29 06:09:37 UTC 2010

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfn32-mips.c

Log Message:
Add a _is_local_label_name routine (taken from elf64-mips.c).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/binutils/dist/bfd/elfn32-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfn32-mips.c
diff -u src/external/gpl3/binutils/dist/bfd/elfn32-mips.c:1.1.1.1 src/external/gpl3/binutils/dist/bfd/elfn32-mips.c:1.2
--- src/external/gpl3/binutils/dist/bfd/elfn32-mips.c:1.1.1.1	Tue Aug 18 09:26:30 2009
+++ src/external/gpl3/binutils/dist/bfd/elfn32-mips.c	Fri Jan 29 06:09:36 2010
@@ -81,6 +81,8 @@
   (bfd *, Elf_Internal_Note *);
 static bfd_boolean elf32_mips_grok_psinfo
   (bfd *, Elf_Internal_Note *);
+static bfd_boolean mips_elf_n32_is_local_label_name
+  (bfd *, const char *);
 static irix_compat_t elf_n32_mips_irix_compat
   (bfd *);
 
@@ -2377,6 +2379,17 @@
   return TRUE;
 }
 
+/* MIPS ELF local labels start with $L.  */
+static bfd_boolean
+mips_elf_n32_is_local_label_name (bfd *abfd, const char *name)
+{
+  if (name[0] == '$'  name[1] == 'L')
+return TRUE;
+
+  /* We accept the generic ELF local label syntax as well.  */
+  return _bfd_elf_is_local_label_name (abfd, name);
+}
+
 /* Depending on the target vector we generate some version of Irix
executables or normal MIPS ELF ABI executables.  */
 static irix_compat_t
@@ -2499,6 +2512,8 @@
 #define elf_backend_write_section	_bfd_mips_elf_write_section
 #define elf_backend_mips_irix_compat	elf_n32_mips_irix_compat
 #define elf_backend_mips_rtype_to_howto	mips_elf_n32_rtype_to_howto
+#define bfd_elf32_bfd_is_local_label_name \
+mips_elf_n32_is_local_label_name
 #define bfd_elf32_find_nearest_line	_bfd_mips_elf_find_nearest_line
 #define bfd_elf32_find_inliner_info	_bfd_mips_elf_find_inliner_info
 #define bfd_elf32_new_section_hook	_bfd_mips_elf_new_section_hook



CVS commit: src/external/gpl3/binutils/dist/bfd

2009-12-23 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Wed Dec 23 09:22:16 UTC 2009

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf32-m68k.c

Log Message:
Fix typo in a comment, no code change.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf32-m68k.c
diff -u src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.1.1.1 src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.2
--- src/external/gpl3/binutils/dist/bfd/elf32-m68k.c:1.1.1.1	Tue Aug 18 09:25:19 2009
+++ src/external/gpl3/binutils/dist/bfd/elf32-m68k.c	Wed Dec 23 09:22:16 2009
@@ -2118,7 +2118,7 @@
   if (ind-got_entry_key != 0)
 {
   BFD_ASSERT (dir-got_entry_key == 0);
-  /* Assert that GOTs aren't partioned yet.  */
+  /* Assert that GOTs aren't partitioned yet.  */
   BFD_ASSERT (ind-glist == NULL);
 
   dir-got_entry_key = ind-got_entry_key;



CVS commit: src/external/gpl3/binutils/dist/bfd

2009-12-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec  7 10:00:21 UTC 2009

Modified Files:
src/external/gpl3/binutils/dist/bfd: elf64-mips.c

Log Message:
Recognize $L as a local symbol for mips64.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/binutils/dist/bfd/elf64-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elf64-mips.c
diff -u src/external/gpl3/binutils/dist/bfd/elf64-mips.c:1.1.1.1 src/external/gpl3/binutils/dist/bfd/elf64-mips.c:1.2
--- src/external/gpl3/binutils/dist/bfd/elf64-mips.c:1.1.1.1	Tue Aug 18 09:26:01 2009
+++ src/external/gpl3/binutils/dist/bfd/elf64-mips.c	Mon Dec  7 10:00:21 2009
@@ -122,6 +122,8 @@
   (bfd *, asymbol *, bfd_boolean, char **, bfd_vma *);
 static bfd_boolean mips_elf64_object_p
   (bfd *);
+static bfd_boolean mips_elf64_is_local_label_name
+  (bfd *, const char *);
 static irix_compat_t elf64_mips_irix_compat
   (bfd *);
 static bfd_boolean elf64_mips_grok_prstatus
@@ -3025,7 +3027,18 @@
   bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach);
   return TRUE;
 }
+
+/* MIPS ELF local labels start with $L.  */
+static bfd_boolean
+mips_elf64_is_local_label_name (bfd *abfd, const char *name)
+{
+  if (name[0] == '$'  name[1] == 'L')
+return TRUE;
 
+  /* We accept the generic ELF local label syntax as well.  */
+  return _bfd_elf_is_local_label_name (abfd, name);
+}
+
 /* Depending on the target vector we generate some version of Irix
executables or normal MIPS ELF ABI executables.  */
 static irix_compat_t
@@ -3248,9 +3261,8 @@
 
 #define elf_backend_write_section	_bfd_mips_elf_write_section
 
-/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit
-   MIPS-specific function only applies to IRIX5, which had no 64-bit
-   ABI.  */
+#define bfd_elf64_bfd_is_local_label_name \
+mips_elf64_is_local_label_name
 #define bfd_elf64_find_nearest_line	_bfd_mips_elf_find_nearest_line
 #define bfd_elf64_find_inliner_info	_bfd_mips_elf_find_inliner_info
 #define bfd_elf64_new_section_hook	_bfd_mips_elf_new_section_hook



CVS commit: src/external/gpl3/binutils/dist/bfd

2009-11-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Nov 15 21:19:35 UTC 2009

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-mips.c

Log Message:
Fix unbalanced parentheses to make this build again.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/binutils/dist/bfd/elfxx-mips.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-mips.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.2 src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.3
--- src/external/gpl3/binutils/dist/bfd/elfxx-mips.c:1.2	Sun Nov 15 10:25:16 2009
+++ src/external/gpl3/binutils/dist/bfd/elfxx-mips.c	Sun Nov 15 21:19:35 2009
@@ -7714,7 +7714,7 @@
 		  || rel[-1].r_offset != rel-r_offset
 		  || r_type != R_MIPS_64
 		  || ELF_R_TYPE(abfd, rel[-1].r_info) != R_MIPS_GPREL32)
-		   (MIPS_ELF_READONLY_SECTION (sec))
+		   MIPS_ELF_READONLY_SECTION (sec))
 		{
 		  /* We tell the dynamic linker that there are
 		 relocations against the text segment.  */



CVS commit: src/external/gpl3/binutils/dist/bfd

2009-08-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Aug 19 10:53:28 UTC 2009

Modified Files:
src/external/gpl3/binutils/dist/bfd: configure

Log Message:
Escape trailing whitespace so it's not lost by make(1).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/binutils/dist/bfd/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/configure
diff -u src/external/gpl3/binutils/dist/bfd/configure:1.2 src/external/gpl3/binutils/dist/bfd/configure:1.3
--- src/external/gpl3/binutils/dist/bfd/configure:1.2	Wed Aug 19 07:19:30 2009
+++ src/external/gpl3/binutils/dist/bfd/configure	Wed Aug 19 10:53:27 2009
@@ -10837,10 +10837,10 @@
 echo $as_me: error: package version not specified 2;}
{ (exit 1); exit 1; }; } ;;
   no)  PKGVERSION= ;;
-  *)   PKGVERSION=($withval)  ;;
+  *)   PKGVERSION=($withval)\  ;;
  esac
 else
-  PKGVERSION=(GNU Binutils) 
+  PKGVERSION=(GNU Binutils)\ 
 
 fi;