bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/23591] New: undefined reference to `__start___sancov_cntrs' when


From: mh-sourceware at glandium dot org
Subject: [Bug ld/23591] New: undefined reference to `__start___sancov_cntrs' when building with clang + asan + fuzzing + ld.bfd
Date: Thu, 30 Aug 2018 04:38:12 +0000

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

            Bug ID: 23591
           Summary: undefined reference to `__start___sancov_cntrs' when
                    building with clang + asan + fuzzing + ld.bfd
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: mh-sourceware at glandium dot org
  Target Milestone: ---

I haven't figured out a small test case, but here's a real world problem:

Get the Firefox/spidermonkey source from https://hg.mozilla.org/mozilla-central

Create a build directory and run the following from under it:
/path/to/mozilla-central/js/src/configure --enable-project=js --enable-fuzzing
--enable-address-sanitizer --enable-linker=bfd CC=clang

(note this also requires llvm-config, rustc, and cargo)

Then run make -j<some-appropriate-number>

The build fails with:
BinSource.cpp:(.text.sancov.module_ctor[sancov.module_ctor]+0x4): undefined
reference to `__start___sancov_cntrs'
BinSource.cpp:(.text.sancov.module_ctor[sancov.module_ctor]+0xb): undefined
reference to `__stop___sancov_cntrs'
BinSource.cpp:(.text.sancov.module_ctor[sancov.module_ctor]+0x17): undefined
reference to `__start___sancov_pcs'
BinSource.cpp:(.text.sancov.module_ctor[sancov.module_ctor]+0x1e): undefined
reference to `__stop___sancov_pcs'

I bisected this to the following commit:

commit 7dba9362c172f1073487536eb137feb2da30b0ff
Author: Alan Modra <address@hidden>
Date:   Fri Jun 16 19:41:41 2017 +0930
    Rewrite __start and __stop symbol handling

    This arranges for __start and __stop symbols to be defined before
    garbage collection, for all target formats.  That should allow the
    COFF and PE --gc-sections to keep a singleton orphan input section,
    a feature lost by 2017-06-13 commit cbd0eecf26.  The fancier ELF
    treatment of keeping all input sections associated with a __start or
    __stop symbol, from 2015-10-23 commit 1cce69b9dc, is retained.

    .startof. and .sizeof. symbols are deliberately not defined before
    garbage collection, so these won't affect garbage collection of
    sections.

    The patch also ensures __start, __stop, .startof. and .sizeof. symbols
    are defined before target size_dynamic_sections is called, albeit
    with a preliminary value, so that target code doesn't need to cope
    with a symbol changing from undefined at size_dynamic_sections to
    defined at relocate_section.

    Also, a number of problems with the testcases have been fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]