.jcr still needs a 0-entry added in crtend, even on !HAVE_CTORS archs. Without it, .jcr section, when no data is present here, overlaps with next section and register_classes in crtbegin will be examining the wrong item.
PR: 241439
Differential D22132
csu: Fix dynamiclib/init_test:jcr_test on !HAVE_CTORS archs kevans on Oct 23 2019, 6:59 PM. Authored by Tags None Referenced Files
Subscribers
Details .jcr still needs a 0-entry added in crtend, even on !HAVE_CTORS archs. Without it, .jcr section, when no data is present here, overlaps with next section and register_classes in crtbegin will be examining the wrong item. PR: 241439
Diff Detail
Event TimelineComment Actions Hmm... so I downloaded FreeBSD-13.0-CURRENT-arm64-aarch64-PINE64-20191018-r353709.img to investigate, and that one seems to have them as well. armv7 (FreeBSD-13.0-CURRENT-arm-armv7-GENERICSD-20191018-r353709.img): $ readelf -a /mnt/usr/lib/debug/bin/ls.debug | grep -Ei '__jcr|\.jcr' [17] .jcr NOBITS 00019000 0000a0 000000 00 WA 0 0 4 20: 0000000000019000 0 OBJECT LOCAL DEFAULT 17 __JCR_LIST__ arm64 (FreeBSD-13.0-CURRENT-arm64-aarch64-PINE64-20191018-r353709.img): $ readelf -a /mnt2/usr/lib/debug/bin/ls.debug | grep -Ei '__jcr|\.jcr' -A1 [16] .jcr NOBITS 0000000000220000 00000090 0000000000000000 0000000000000000 WA 0 0 8 -- 44: 0000000000220000 0 OBJECT LOCAL DEFAULT 16 __JCR_LIST__ 45: 0000000000210234 52 FUNC LOCAL DEFAULT 12 register_classes (I had to -A1 it so the size was included, and the section at least still exists in /bin/ls) Given this, I suspect the __JCR_LIST__ reference in crtbegin is creating the 0-sized section. I would think maybe a difference from clang 8 -> 9 since base only moved forward not that long ago, but perhaps you've upgraded beyond that already. |