Skip to content

Commit 0b6e5e3

Browse files
4a6f656cminux
authored andcommitted
cmd/link: specify correct size for dynamic symbols in 386 elf output
Currently 386 ELF binaries are generated with dynamic symbols that have a size of zero bytes, even though the symbol in the symbol table has the correct size. Fix this by specifying the correct size when creating dynamic symbols. Issue found on OpenBSD -current, where ld.so is now producing link warnings due to mismatched symbol sizes. Fixes #15593. Change-Id: Ib1a12b23ff9159c61ac980bf48a983b86f3df256 Reviewed-on: https://go-review.googlesource.com/22912 Reviewed-by: Minux Ma <[email protected]> Run-TryBot: Minux Ma <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 394ac81 commit 0b6e5e3

File tree

1 file changed

+2
-2
lines changed
  • src/cmd/link/internal/ld

1 file changed

+2
-2
lines changed

src/cmd/link/internal/ld/elf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,8 +2665,8 @@ func Elfadddynsym(ctxt *Link, s *LSym) {
26652665
Addaddr(ctxt, d, s)
26662666
}
26672667

2668-
/* size */
2669-
Adduint32(ctxt, d, 0)
2668+
/* size of object */
2669+
Adduint32(ctxt, d, uint32(s.Size))
26702670

26712671
/* type */
26722672
t := STB_GLOBAL << 4

0 commit comments

Comments
 (0)