* target-reloc.h (relocate_section): Fix dead-pointer bug.
authorCary Coutant <ccoutant@google.com>
Thu, 1 May 2008 02:01:23 +0000 (02:01 +0000)
committerCary Coutant <ccoutant@google.com>
Thu, 1 May 2008 02:01:23 +0000 (02:01 +0000)
gold/ChangeLog
gold/target-reloc.h

index c0612930773559a5ec81d744709bb365e8076687..246cf08ada5d5f8a9e0da9a8381284645206f4f1 100644 (file)
@@ -1,5 +1,7 @@
 2008-04-30  Cary Coutant  <ccoutant@google.com>
 
+       * target-reloc.h (relocate_section): Fix dead-pointer bug.
+
        * layout.cc (Layout::include_section): Refactored check for debug
        info section.
        (Layout::add_comdat): Add new parameters.  Change type
index e1c3cc37b69892120bc26935a820919dadc9d922..d06dc82023bcd759328c4828fe46d5b8a17de5a2 100644 (file)
@@ -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)
                {