]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: fix SLIBFUZZER_EXTRA_COUNTER symbol handling
authorCherry Zhang <cherryyz@google.com>
Thu, 14 May 2020 20:11:53 +0000 (16:11 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 14 May 2020 21:41:46 +0000 (21:41 +0000)
Found this while deleting the old code. This should be data2.

Change-Id: I1232fac22ef63bb3a3f25a0558537cc371af3bd9
Reviewed-on: https://go-review.googlesource.com/c/go/+/234098
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/ld/data.go

index 13ccb86a0355d4b6557bb0c0dc0d902131d9938c..e29b6e8e3bd2e89868e1d55152b6d9fba212978e 100644 (file)
@@ -1730,7 +1730,7 @@ func (state *dodataState) allocateDataSections2(ctxt *Link) {
        ldr.SetSymSect(ldr.LookupOrCreateSym("runtime.end", 0), sect)
 
        // Coverage instrumentation counters for libfuzzer.
-       if len(state.data[sym.SLIBFUZZER_EXTRA_COUNTER]) > 0 {
+       if len(state.data2[sym.SLIBFUZZER_EXTRA_COUNTER]) > 0 {
                state.allocateNamedSectionAndAssignSyms2(&Segdata, "__libfuzzer_extra_counters", sym.SLIBFUZZER_EXTRA_COUNTER, sym.Sxxx, 06)
        }