• Russ Cox's avatar
    runtime: remove assumption that noptrdata data bss noptrbss are ordered and contiguous · 378c2515
    Russ Cox authored
    The assumption can be violated by external linkers reordering them or
    inserting non-Go sections in between them. I looked briefly at trying
    to write out the _go_.o in external linking mode in a way that forced
    the ordering, but no matter what there's no way to force Go's data
    and Go's bss to be next to each other. If there is any data or bss from
    non-Go objects, it's very likely to get stuck in between them.
    
    Instead, rewrite the two places we know about that make the assumption.
    I grepped for noptrdata to look for more and didn't find any.
    
    The added race test (os/exec in external linking mode) fails without
    the changes in the runtime. It crashes with an invalid pointer dereference.
    
    Fixes #9133.
    
    LGTM=dneil
    R=dneil
    CC=dvyukov, golang-codereviews, iant
    https://golang.org/cl/179980043
    378c2515
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...