This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Simple bug fix in gold linker.
On Fri, May 25, 2012 at 3:36 PM, Ian Lance Taylor <iant@google.com> wrote:
> Sriraman Tallam <tmsriram@google.com> writes:
>
>> ? ?Patch ok? This was causing an uninitialized variable error while building.
>>
>> ? ? ? * symtab.cc (Symbol_table::add_undefined_symbol_from_command_line):
>> ? ? ? Initialize oldsym to prevent uninitialized variable errors.
>
> Instead of this, change Symbol_table::define_special_symbol to set
> *poldsym = NULL at the top of the function. ?That patch is approved if
> it fixes the problem.
Thanks, this is a much better fix. When I marked define_special_symbol
to be always inline to test, it failed in another place so the
previous patch would have not fully addressed the problem.
Committed this patch:
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gold/ChangeLog,v
retrieving revision 1.917
diff -u -u -p -r1.917 ChangeLog
--- ChangeLog 24 May 2012 01:02:14 -0000 1.917
+++ ChangeLog 25 May 2012 22:53:09 -0000
@@ -1,3 +1,8 @@
+2012-05-25 Sriraman Tallam <tmsriram@google.com>
+
+ * symtab.cc (Symbol_table::define_special_symbol):
+ Initialize *poldsym to prevent uninitialized variable errors.
+
2012-05-23 Cary Coutant <ccoutant@google.com>
* layout.cc (Layout::section_name_mapping): Add rules to handle
Index: symtab.cc
===================================================================
RCS file: /cvs/src/src/gold/symtab.cc,v
retrieving revision 1.165
diff -u -u -p -r1.165 symtab.cc
--- symtab.cc 22 May 2012 23:50:52 -0000 1.165
+++ symtab.cc 25 May 2012 22:53:09 -0000
@@ -1682,6 +1682,7 @@ Symbol_table::define_special_symbol(cons
bool* resolve_oldsym)
{
*resolve_oldsym = false;
+ *poldsym = NULL;
Thanks,
-Sri.
>
> Ian