[binutils-gdb] COFF: correct function auxiliary symbol data clearing
Jan Beulich
jbeulich@sourceware.org
Fri May 2 08:11:23 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=89911183bd070b9e21a520db3a5213a7d1910bf6
commit 89911183bd070b9e21a520db3a5213a7d1910bf6
Author: Jan Beulich <jbeulich@suse.com>
Date: Fri May 2 10:08:19 2025 +0200
COFF: correct function auxiliary symbol data clearing
It's unclear why the array part of the union was used there, when we're
dealing with a function. Originally, when 32-bit hosts and targets were
prevailing, the memset() in question ended up clearing the entire x_fcn,
while for 64-bit hosts/targets only x_lnnoptr would have been cleared.
Then a2c7ca15a560 ("Use stdint types in coff internal_auxent") made
things consistent, but imo in the wrong direction (and likely
unintentionally). Go back to what apparently was meant originally, using
the correct part of the union now.
Diff:
---
gas/config/obj-coff.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index 445f2ac764d..2c95ba9038f 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -1345,8 +1345,8 @@ coff_frob_symbol (symbolS *symp, int *punt)
if (S_GET_NUMBER_AUXILIARY (symp) < 1)
S_SET_NUMBER_AUXILIARY (symp, 1);
auxp = SYM_AUXENT (symp);
- memset (auxp->x_sym.x_fcnary.x_ary.x_dimen, 0,
- sizeof (auxp->x_sym.x_fcnary.x_ary.x_dimen));
+ memset (&auxp->x_sym.x_fcnary.x_fcn, 0,
+ sizeof (auxp->x_sym.x_fcnary.x_fcn));
}
if (S_GET_STORAGE_CLASS (symp) == C_EFCN
More information about the Binutils-cvs
mailing list