https://sourceware.org/bugzilla/show_bug.cgi?id=17047

            Bug ID: 17047
           Summary: BFD ld crashes on cleanup, if MALLOC_PERTURB_ is set
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: ueno at gnu dot org

Created attachment 7632
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7632&action=edit
a patch

When running the BFD ld with MALLOC_PERTURB_ set, it crashes in the
cleanup phase:

$ echo "int main () { return 0; }" > t.c
$ MALLOC_PERTURB_=1 ./ld/ld-new t.o
./ld/ld-new: warning: cannot find entry symbol _start; defaulting to
00000000004000b0
zsh: segmentation fault (core dumped)

It seems that _bfd_merge_sections_free is traversing already freed
memory.  I'm attaching a patch.

-- 
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