This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] GAS: Fix `abort' expansion in write.c
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: <binutils at sourceware dot org>
- Date: Tue, 28 Jun 2016 17:33:38 +0100
- Subject: [PATCH] GAS: Fix `abort' expansion in write.c
- Authentication-results: sourceware.org; auth=none
Remove an internal diagnostic regression introduced with the inclusion of
"libbfd.h" from write.c, added with:
commit e7ff5c732e7b95aafccd0910ea1a5cb8251a1033
Author: Alan Modra <amodra@gmail.com>
Date: Fri Feb 16 03:40:17 2007 +0000
That change made "libbfd.h" override the `abort' definition provided by
"as.h" earlier on, making the message produced by any calls reached from
write.c, which is a part of the GAS proper, look like they came from
BFD, e.g.:
.../gas/testsuite/gas/elf/type.s: Assembler messages:
.../gas/testsuite/gas/elf/type.s:30: Error: symbol type "gnu_unique_object" is supported only by GNU targets
../as-new: BFD (GNU Binutils) 2.26.51.20160628 internal error, aborting at .../gas/write.c:608 in size_seg
../as-new: Please report this bug.
vs:
.../gas/testsuite/gas/elf/type.s: Assembler messages:
.../gas/testsuite/gas/elf/type.s:30: Error: symbol type "gnu_unique_object" is supported only by GNU targets
.../gas/testsuite/gas/elf/type.s: Internal error, aborting at .../gas/write.c:602 in size_seg
Please report this bug.
With the removal of "libbfd.h" restore the latter message format.
gas/
* write.c: Remove "libbfd.h" inclusion.
---
Hi,
This has passed regression testing over my usual set of 162 targets so I
take it whatever the reason for the inclusion of "libbfd.h" was it is no
longer there and rather than thinking of a way to avoid the override made
by "libbfd.h" we can simply remove the offending inclusion. No other
generic GAS source includes this header; target maintainers may want to
review their code though.
OK to apply?
Maciej
binutils-gas-write-abort.diff
Index: binutils/gas/write.c
===================================================================
--- binutils.orig/gas/write.c 2016-06-17 16:36:16.000000000 +0100
+++ binutils/gas/write.c 2016-06-22 02:47:36.692266097 +0100
@@ -25,7 +25,6 @@
#include "obstack.h"
#include "output-file.h"
#include "dwarf2dbg.h"
-#include "libbfd.h"
#include "compress-debug.h"
#ifndef TC_FORCE_RELOCATION