This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Wed, 10 Oct 2012 19:06:59 +0200
- Subject: [patch
Hi,
this patch fixes an old and latent bug about aux-symbols for pe-coff.
For example for the following code:
.text
.globl _localtu1
.def _localtu1; .scl 3; .type 32; .endef
_localtu1:
ret
.globl _localtu
.def _localtu; .scl 2; .type 32; .endef
_abc:
call _exttu
ret
.def _exttu; .scl 2; .type 32; .endef
.def _localtu; .scl 3; .type 32; .endef
.def _localtu1; .scl 3; .type 32; .endef
we are generating without the patch a wrong sequence of the aux
symbols for function _localtu.
ChangeLog gas
2012-10-10 Kai Tietz
* config/obj-coff.c: Add include of struc-symbol.h header.
(coff_frob_symbol): Check that function-aux entries are generated for
defined symbols only.
Tested for i686-w64-mingw32, and x86_64-w64-mingw32. ok for apply?
Regards,
Kai
Index: gas/config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.112
diff -u -p -r1.112 obj-coff.c
--- gas/config/obj-coff.c 27 Sep 2011 18:57:22 -0000 1.112
+++ gas/config/obj-coff.c 1 Oct 2012 14:54:27 -0000
@@ -26,6 +26,7 @@
#include "safe-ctype.h"
#include "obstack.h"
#include "subsegs.h"
+#include "struc-symbol.h"
#ifdef TE_PE
#include "coff/pe.h"
@@ -1359,7 +1360,8 @@ coff_frob_symbol (symbolS *symp, int *pu
}
}
- if (coff_last_function == 0 && SF_GET_FUNCTION (symp))
+ if (coff_last_function == 0 && SF_GET_FUNCTION (symp)
+ && S_IS_DEFINED (symp))
{
union internal_auxent *auxp;
@@ -1371,7 +1373,8 @@ coff_frob_symbol (symbolS *symp, int *pu
sizeof (auxp->x_sym.x_fcnary.x_ary.x_dimen));
}
- if (S_GET_STORAGE_CLASS (symp) == C_EFCN)
+ if (S_GET_STORAGE_CLASS (symp) == C_EFCN
+ && S_IS_DEFINED (symp))
{
if (coff_last_function == 0)
as_fatal (_("C_EFCN symbol for %s out of scope"),