http://sourceware.org/bugzilla/show_bug.cgi?id=13099

             Bug #: 13099
           Summary: Incorrect check for .gnu.linkonce section
           Product: binutils
           Version: 2.22 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassig...@sources.redhat.com
        ReportedBy: hjl.to...@gmail.com
    Classification: Unclassified


elflink.c has

     if (CONST_STRNEQ (name, ".gnu.linkonce.")
          && ((p = strchr (name + sizeof (".gnu.linkonce.") - 1, '.')) 
              != NULL))
        p++;  

For

(gdb) p name
$12 = 0x8750ba ".gnu.linkonce.this_module"
(gdb)

strchr is called on

(gdb) p name + sizeof (".gnu.linkonce.") - 1
$13 = 0x8750c8 "this_module"
(gdb) 

Instead we should pass

(gdb) p name + sizeof (".gnu.linkonce.") - 2
$14 = 0x8750c7 ".this_module"
(gdb) 

to strchr.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to