• Michael Hudson-Doyle's avatar
    cmd/internal/obj: fix stack barriers in ppc64le shared libs · 3a1bed82
    Michael Hudson-Doyle authored
    runtime.stackBarrier is a strange function: it is only ever "called" by
    smashing its address into a LR slot on the stack. Calling it like this
    certainly does not adhere to the rule that r12 is set to the global entry point
    before calling it and the prologue instrutions that compute r2 from r12 in fact
    just corrupt r2, which is bad because the function that stackBarrier returns to
    probably uses r2 to access global data.
    
    Fortunately stackBarrier itself does not access any global data and so does not
    depend on the value of r2, meaning we can ignore the ABI rules and simply skip
    inserting the prologue instructions into this specific function.
    
    Fixes 64bit.go, append.go and fixedbugs/issue13169.go from "cd test; go run
    run.go -linkshared".
    
    Change-Id: I606864133a83935899398e2d42edd08a946aab24
    Reviewed-on: https://go-review.googlesource.com/17281Reviewed-by: 's avatarAustin Clements <austin@google.com>
    3a1bed82
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...