This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH COMMITTED: Fix gold handling of relocations to discarded comdat sections
- From: "Cary Coutant" <ccoutant at google dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Wed, 30 Apr 2008 19:04:17 -0700
- Subject: PATCH COMMITTED: Fix gold handling of relocations to discarded comdat sections
One more fix -- I found a problem where I was using a pointer after
the object it pointed to had gone out of scope.
* target-reloc.h (relocate_section): Fix dead-pointer bug.
Also approved off-list and committed.
-cary
Index: target-reloc.h
===================================================================
RCS file: /cvs/src/src/gold/target-reloc.h,v
retrieving revision 1.24
diff -u -p -r1.24 target-reloc.h
--- target-reloc.h 1 May 2008 01:23:21 -0000 1.24
+++ target-reloc.h 1 May 2008 01:59:17 -0000
@@ -227,9 +227,8 @@ relocate_section(
{
if (comdat_behavior == CB_UNDETERMINED)
{
- const char* name =
- object->section_name(relinfo->data_shndx).c_str();
- comdat_behavior = get_comdat_behavior(name);
+ std::string name = object->section_name(relinfo->data_shndx);
+ comdat_behavior = get_comdat_behavior(name.c_str());
}
if (comdat_behavior == CB_PRETEND)
{