Andreas Schwab | 20 May 20:02

[PATCH] Add support for m68k-linux core file notes

Tested on m68k-linux and powerpc-linux.

Andreas.

	* elf32-m68k.c (elf_m68k_grok_prstatus): New function.
	(elf_m68k_grok_psinfo): New function.
	(elf_backend_grok_prstatus): Define.
	(elf_backend_grok_psinfo): Define.
---
 bfd/elf32-m68k.c |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index b66f95a..6c12fa7 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -4821,6 +4821,69 @@ elf_m68k_plt_sym_val (bfd_vma i, const asection *plt,
   return plt->vma + (i + 1) * elf_m68k_get_plt_info (plt->owner)->size;
 }

+/* Support for core dump NOTE sections.  */
+
+static bfd_boolean
+elf_m68k_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
+{
+  int offset;
+  size_t size;
+
+  switch (note->descsz)
+    {
(Continue reading)

Alan Modra | 19 May 12:40
Picon

tic6x testsuite now clean

Today's lucky target to be brought back to zero testsuite fails is
tic6x-elf.  Committed.

gas/
	* config/obj-elf.c (obj_elf_section): Cater for TC_KEEP_OPERAND_SPACES
	targets when checking for "comdat".
gas/testsuite/
	* gas/tic6x/unwind-1.d: Update for readelf changes.
	* gas/tic6x/unwind-2.d: Likewise.
	* gas/tic6x/unwind-3.d: Likewise.
ld/testsuite/
	* ld-elf/elf.exp (note-3.so): xfail tic6x due to non-pic warnings.

Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.145
diff -u -p -r1.145 obj-elf.c
--- gas/config/obj-elf.c	2 Feb 2012 09:26:04 -0000	1.145
+++ gas/config/obj-elf.c	19 May 2012 06:16:37 -0000
@@ -1049,10 +1049,15 @@ obj_elf_section (int push)
 	      group_name = obj_elf_section_name ();
 	      if (group_name == NULL)
 		attr &= ~SHF_GROUP;
-	      else if (strncmp (input_line_pointer, ",comdat", 7) == 0)
+	      else if (*input_line_pointer == ',')
 		{
-		  input_line_pointer += 7;
-		  linkonce = 1;
+		  ++input_line_pointer;
(Continue reading)

Alan Modra | 19 May 09:07
Picon

Failing PowerPC VLE tests

The failing VLE testcases annoyed me enough to fix them.  It turns out
that these failures
	FAIL: VLE multiple segments 1
	FAIL: VLE multiple segments 2
	FAIL: VLE multiple segments 3
are because ppc_elf_modify_segment_map isn't working.  The trouble
with using one of the packed bit section flags to mark VLE sections is
that these bits are not copied from input to output sections.
ppc_elf_modify_segment_map looks at output sections.  However, ELF
sh_flags are copied.  So use ELF sh_flags and get rid of the bfd
section flag entirely. 

These two failures
	FAIL: VLE relocations 2
	FAIL: VLE relocations 3
are due to the alignment of an empty .eh_frame affecting following
section addresses.  The cure is to use a custom linker script that
discards any unneeded sections.

bfd/
	* elf32-ppc.h (has_vle_insns, is_ppc_vle): Delete.
	(has_tls_reloc, has_tls_get_addr_call): Move back to..
	* elf32-ppc.c: ..here.
	(ppc_elf_section_flags, elf_backend_section_flags): Delete.
	(ppc_elf_modify_segment_map): Use ELF sh_flags to detect VLE sections.
opcodes/
	* ppc-dis.c: Don't include elf32-ppc.h, do include elf/ppc.h.
	(get_powerpc_dialect): Detect VLE sections from ELF sh_flags.
ld/testsuite/
	* ld-powerpc/vle.ld: New.
(Continue reading)

Mike Frysinger | 19 May 05:35
Picon
Favicon
Gravatar

[PATCH] gas: mips: fix segfault with invalid default cpu strings

If you configure gas for a mips32el-* target, the default cpu calculation
gets mangled, and we end up passing and invalid value as the default cpu.

If you try executing gas after that, it segfaults.  This is because it
assumes that the default cpu value is always valid.
$ ./gas/as-new
Assembler messages:
Error: Bad value (2) for default CPU
Segmentation fault (core dumped)

I'm not debating that the target tuple is valid, just that gas shouldn't
crash.  So add a friendly assert to avoid that.

Signed-off-by: Mike Frysinger <vapier <at> gentoo.org>

2012-05-18  Mike Frysinger  <vapier <at> gentoo.org>

	* config/tc-mips.c (mips_after_parse_args): Assert that arch_info
	is non-NULL.
---
 gas/config/tc-mips.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index d6b8ecb..4760c05 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -15005,7 +15005,10 @@ mips_after_parse_args (void)
     }

(Continue reading)

Jan Kratochvil | 18 May 23:14
Picon
Favicon

[RFC patch] non-release srctrees: --enable-targets=all & 64bit & -lmcheck

Hi,

--enable-targets=all commonly discovers checked in regressions:
	http://sourceware.org/ml/binutils/2012-05/msg00271.html
	http://sourceware.org/ml/gdb-patches/2012-05/msg00548.html
	http://sourceware.org/ml/gdb-patches/2012-05/msg00003.html
	http://sourceware.org/ml/gdb-patches/2012-03/msg00279.html
	http://sourceware.org/ml/gdb-patches/2011-03/msg00600.html
	(many more, I did not search too thoroughly)

--enable-64-bit-bfd is required for full --enable-targets=all.

-lmcheck is cheap enough to never be noticed and it also finds checked in
regressions:
	http://sourceware.org/ml/gdb-patches/2012-03/msg00589.html
	http://sourceware.org/ml/gdb-patches/2012-02/msg00612.html
	(many more, I did not search too thoroughly)

As Joel already turns off -Werror (for gdb/) for release branches it could be
just extended for more options.  (This patch requires running autoconf in
bfd/, opcodes/ and gdb/ after changing config/development.m4.)

Unfortuntely this patch cannot be limited only to gdb/ :
-lmcheck could be applied also for ld/, gold/, gas/, gprof/ and binutils/.
I have been targeting only gdb/ and its pre-requisites so far.

Thanks,
Jan

bfd/
(Continue reading)

Francois Gouget | 18 May 16:15

More fixes for files bigger than 2GB


This is related to PR 13534 but most of it was fixed already.
http://sourceware.org/bugzilla/show_bug.cgi?id=13534

So the best was to test for this now is to archive / unarchive a 4GB 
file on a 32bit system:

$ dd if=/dev/zero of=file4G bs=1M count=4096
4096+0 enregistrements lus
4096+0 enregistrements écrits
4294967296 bytes (4,3 GB) copied, 44,7366 s, 96,0 MB/s
$ ./binutils/ar q ar4G.ar file4G
$ ./binutils/ar tv ar4G.ar
rw-r--r-- 1001/2000      0 May 18 08:29 2012 file4G
$ ./binutils/ar x ar4G.ar
$ ls -l file4G
-rw-r--r-- 1 gouget cw 0 mai 18 14:06 file4G
$ ./binutils/ar p ar4G.ar >file4G
$ ls -l file4G
-rw-r--r-- 1 gouget cw 0 mai 18 14:07 file4G

This issue happens because of the conversion of the st_size values which 
are typically of the off64_t type to size_t variables that can only hold 
unsigned 32bit values. Archive element sizes should only ever be held in 
bfd_size_type variables.

The bucomm.c (print_arelt_descr) chunks fix 'ar tv', the ar.c 
(print_contents) chunks fix 'ar p' and the ar.c (extract_file) chunks 
fix 'ar x'.

(Continue reading)

Alan Modra | 18 May 07:49
Picon

work around daft warning

.../gas/config/tc-dlx.c: In function ‘s_proc’:
.../gas/config/tc-dlx.c:248:15: error: ignoring return value of ‘asprintf’, declared with
attribute warn_unused_result [-Werror=unused-result]

	* config/tc-dlx.c (s_proc): Avoid warning about ignoring asprintf
	return value.

Index: gas/config/tc-dlx.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-dlx.c,v
retrieving revision 1.25
diff -u -p -r1.25 tc-dlx.c
--- gas/config/tc-dlx.c	17 May 2012 15:13:16 -0000	1.25
+++ gas/config/tc-dlx.c	18 May 2012 05:18:49 -0000
@@ -245,7 +245,10 @@ s_proc (int end_p)
 	  /* Missing entry point, use function's name with the leading
 	     char prepended.  */
 	  if (leading_char)
-	    asprintf (&label, "%c%s", leading_char, name);
+	    {
+	      if (asprintf (&label, "%c%s", leading_char, name))
+		{ /* Avoid warning */ }
+	    }
 	  else
 	    label = name;
 	}

--

-- 
Alan Modra
Australia Development Lab, IBM
(Continue reading)

Roland McGrath | 17 May 22:45
Picon
Favicon

[PATCH] fix ar/ranlib regression with ar_fmag clobberation

This change:

	2012-05-16  Alan Modra  <amodra <at> gmail.com>

		* archive.c (_bfd_generic_read_ar_hdr_mag):  Ensure sscanf
		stops at end of ar_size field.

results in clobbering the stored ar_fmag field.  Among other things,
this makes ranlib produce a malformed archive.

A simple fix is below.

Ok for trunk?

Thanks,
Roland

bfd/
2012-05-17  Roland McGrath  <mcgrathr <at> google.com>

	* archive.c (_bfd_generic_read_ar_hdr_mag): Fix last change so as
	not to clobber the ar_fmag field stored in ARED->arch_header.

diff --git a/bfd/archive.c b/bfd/archive.c
index eb5f5ec..26547ba 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -455,6 +455,8 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag)
   char *allocptr = 0;
   file_ptr origin = 0;
(Continue reading)

Roland McGrath | 17 May 22:00
Picon
Favicon

[PATCH] allow nested .bundle_lock

I came across a use case for letting .bundle_lock/.bundle_unlock pairs nest.

Ok for trunk?

Thanks,
Roland

gas/
2012-05-17  Roland McGrath  <mcgrathr <at> google.com>

	* read.c [HANDLE_BUNDLE] (bundle_lock_depth): New variable.
	(read_a_source_file) [HANDLE_BUNDLE]: Reset it.
	[HANDLE_BUNDLE] (s_bundle_lock, s_bundle_unlock): Allow nested
	pairs.

gas/testsuite/
2012-05-17  Roland McGrath  <mcgrathr <at> google.com>

	* gas/i386/bundle-bad.s: Remove nested .bundle_lock case.
	* gas/i386/bundle-bad.l: Remove expected error line.
	* gas/i386/bundle-lock.s: Add nested .bundle_lock case.
	* gas/i386/bundle-lock.d: Update expectations.

diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
index 694c806..6608958 100644
--- a/gas/doc/as.texinfo
+++ b/gas/doc/as.texinfo
@@ -4346,9 +4346,12 @@ first instruction of the sequence so that the whole sequence starts on an
 aligned bundle boundary.  It's an error if the sequence is longer than the
 bundle size.
(Continue reading)

Roland McGrath | 17 May 21:53
Picon
Favicon

configure vs libtool mismatch after PR 14072 change

This probably has the same cause as what Tom noticed.

Today's change:

gas/
	2012-05-17  Daniel Richard G.  <skunk <at> iskunk.org>
		    Nick Clifton  <nickc <at> redhat.com>

		PR 14072
		* configure.in: Add check that sysdep.h has been included before
		any system header files.
		* configure: Regenerate.
		* config.in: Regenerate.
		* aclocal.m4: Regenerate.
		* Makefile.am: Use wrappers around C files generated by flex.
		* Makefile.in: Regenerate.
		* doc/Makefile.in: Regenerate.
		* itbl-lex-wrapper.c: New file.
		* config/bfin-lex-wrapper.c: New file.
		* cgen.c: Include as.h before setjmp.h.
		* config/tc-dlx.c: Include as.h before any other header.
		* config/tc-h8300.c: Likewise.
		* config/tc-lm32.c: Likewise.
		* config/tc-mep.c: Likewise.
		* config/tc-microblaze.c: Likewise.
		* config/tc-mmix.c: Likewise.
		* config/tc-msp430.c: Likewise.
		* config/tc-or32.c: Likewise.
		* config/tc-tic4x.c: Likewise.
		* config/tc-tic54x.c: Likewise.
(Continue reading)

James Lemke | 17 May 21:04

[RFA] Add missing VLE entries to powerpc_macros

This resolves the failing gas test: vle-simple-5.
OK to commit?

-- 
Jim Lemke
Mentor Graphics / CodeSourcery
Orillia Ontario,  +1-613-963-1073

2012-05-17  James Lemke  <jwlemke <at> codesourcery.com>

	* ppc-opc.c (powerpc_macros): Add entries for e_extlwi to e_clrlslwi.

Index: opcodes/ppc-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
retrieving revision 1.142
diff -u -p -r1.142 ppc-opc.c
--- opcodes/ppc-opc.c	14 May 2012 19:45:30 -0000	1.142
+++ opcodes/ppc-opc.c	17 May 2012 18:59:02 -0000
@@ -6451,6 +6451,18 @@ const struct powerpc_macro powerpc_macro
 {"clrrwi.",  3,	PPCCOM,	"rlwinm. %0,%1,0,0,31-(%2)"},
 {"clrlslwi", 4,	PPCCOM,	"rlwinm %0,%1,%3,(%2)-(%3),31-(%3)"},
 {"clrlslwi.",4, PPCCOM,	"rlwinm. %0,%1,%3,(%2)-(%3),31-(%3)"},
+
+{"e_extlwi", 4,	PPCVLE, "e_rlwinm %0,%1,%3,0,(%2)-1"},
+{"e_extrwi", 4,	PPCVLE, "e_rlwinm %0,%1,((%2)+(%3))&((%2)+(%3)<>32),32-(%2),31"},
+{"e_inslwi", 4,	PPCVLE, "e_rlwimi %0,%1,(-(%3)!31)&((%3)|31),%3,(%2)+(%3)-1"},
+{"e_insrwi", 4,	PPCVLE, "e_rlwimi %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1"},
(Continue reading)


Gmane