Don't indirect our own BSS accessor functions.

delocate.go was adding redirector functions for the “_bss_get”
functions. (And they were going via the PLT too.)

Change-Id: I86bc9f0516a128a769068182cc280499f89b6c29
Reviewed-on: https://boringssl-review.googlesource.com/15148
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Adam Langley 2017-04-17 13:01:32 -07:00
parent e2a701ea1e
commit 1bd689d1fc

View File

@ -184,6 +184,13 @@ func transform(lines []string, symbols map[string]bool) (ret []string) {
continue
}
if strings.HasSuffix(target, "_bss_get@PLT") || strings.HasSuffix(target, "_bss_get") {
// reference to a synthesised function. Don't
// indirect ourselves and drop PLT indirection.
ret = append(ret, strings.Replace(line, "@PLT", "", 1))
continue
}
if isGlobal, ok := symbols[target]; ok {
newTarget := target
if isGlobal {
@ -264,7 +271,6 @@ func transform(lines []string, symbols map[string]bool) (ret []string) {
p := strings.Split(parts[1], ",")
name := p[0]
bssAccessorsNeeded = append(bssAccessorsNeeded, name)
symbols[accessorName(name)] = false
ret = append(ret, line)
case ".section":