aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/objfile/elf.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2023-05-02 01:06:11 +0700
committerShulhan <m.shulhan@gmail.com>2024-01-25 04:01:14 +0700
commit8096b47dd09fcda8712f7a3c07dced5244123a4d (patch)
tree26339e20861f0d89cff1cf3dc763d7b99b4aaee8 /src/cmd/internal/objfile/elf.go
parent54386c4a7e68ab281545116220600f670e8f9e14 (diff)
downloadgo-8096b47dd09fcda8712f7a3c07dced5244123a4d.tar.xz
all: prealloc slice with possible minimum capabilities
Diffstat (limited to 'src/cmd/internal/objfile/elf.go')
-rw-r--r--src/cmd/internal/objfile/elf.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/internal/objfile/elf.go b/src/cmd/internal/objfile/elf.go
index f25e4a65d6..e12e273684 100644
--- a/src/cmd/internal/objfile/elf.go
+++ b/src/cmd/internal/objfile/elf.go
@@ -32,7 +32,7 @@ func (f *elfFile) symbols() ([]Sym, error) {
return nil, err
}
- var syms []Sym
+ syms := make([]Sym, 0, len(elfSyms))
for _, s := range elfSyms {
sym := Sym{Addr: s.Value, Name: s.Name, Size: int64(s.Size), Code: '?'}
switch s.Section {