This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ia64 missing initialization in unwind info
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 01 Jan 2008 20:03:49 -0200
- Subject: ia64 missing initialization in unwind info
I needed this patch in order to get ia64-linux-gnu target libraries
built along with GCC to pass bootstrap4-debug compare when built with
or without debug information.
The space reserved to hold the unwind personality function address is
uninitialized and, in certain cases (for example, when compiling
certain files without debug information), it often contains garbage.
I haven't investigated why, when compiling with debug information, it
is most often zero-initialized, but the obvious solution is to have it
initialized.
I don't have a small testcase, the actual uninitialized pattern varies
depending on whether I'm natively or cross-assembling, which means it
could pass by accident, and it could possibly even vary depending on
memory layout.
The problem showed up in a native bootstrap of the GCC
var-tracking-assignments-branch on ia64-linux-gnu (RHEL5.1) with a
number of patches I plan to post and install today, in the files:
gcc/ada/rts/a-nscefu.o
ia64-unknown-linux-gnu/libstdc++-v3/src/.libs/locale-inst.o
ia64-unknown-linux-gnu/libstdc++-v3/src/locale-inst.o
Ok to install?
Happy GNU Year!
Index: gas/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/tc-ia64.c (ia64_convert_frag): Zero-initialize room for
unwind personality function address.
Index: gas/config/tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.199
diff -u -p -r1.199 tc-ia64.c
--- gas/config/tc-ia64.c 19 Nov 2007 18:15:53 -0000 1.199
+++ gas/config/tc-ia64.c 1 Jan 2008 21:54:04 -0000
@@ -1,5 +1,5 @@
/* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
@@ -3166,6 +3166,10 @@ ia64_convert_frag (fragS *frag)
if (pad != 0)
md_number_to_chars (frag->fr_literal + len + 8 - md.pointer_size + pad, 0,
md.pointer_size - pad);
+ /* Fill the unwind personality with zeros. */
+ if (frag->fr_offset)
+ md_number_to_chars (frag->fr_literal + size - md.pointer_size, 0,
+ md.pointer_size);
frag->fr_fix += size;
frag->fr_type = rs_fill;
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}