aboutsummaryrefslogtreecommitdiff
path: root/util/read_symbols.go
AgeCommit message (Collapse)AuthorFilesLines
2024-03-17Filter out DW.ref.__gxx_personality_v0 in read_symbols.goDavid Benjamin1-1/+1
As documented, the symbol prefixing mechanism is experimental and unsupported. There are several corners where we know it doesn't give the correct output. Nonetheless, this is an easy one to fix. Fixed: 707 Change-Id: I69a3e61a3198a193cb90f822218f1efbaa31fb1a Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67067 Auto-Submit: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com>
2023-05-02Replace interface{} with anyDavid Benjamin1-1/+1
Satisfy a go lint. As of Go 1.18, any is the preferred spelling of interface{}. Also remove an instance of redundant types in util/fipstools/acvp/acvptool/acvp.go because my editor warned about it. (A []map[string]any{map[string]any{...}, map[string]any{...}} literal can omit the inner copy of the type because it's implicit from the outer one.) Change-Id: I2251b2285c16c19bc779fa41d1011f7fa1392563 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/59465 Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com>
2023-04-25Re-add go:build ignore linesDavid Benjamin1-0/+2
This reverts commit bab2f96e2637acb107fe9b099c58befbca918748. This clears the sea of red in my editor. Change-Id: I600ef6c36556fb526da729f0f0d8bc69db5c5a08 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/59186 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2023-02-27Ignore elf.ErrNoSymbols in util/read_symbols.goDavid Benjamin1-0/+3
It seems empty assembly files generate object files without a symbol section at all. Just skip them. Change-Id: I1bf06050dbde793e57faaeb2e40bcc4b6de497a6 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/57665 Commit-Queue: Bob Beck <bbe@google.com> Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2023-02-16Revert go:build ignore linesDavid Benjamin1-2/+0
This convention seems to break with some other tooling we have. Until we figure out how to resolve that, remove the lines. This partially reverts 54b04fdc21d540a6e24f9ddb7ddc3e583518e24f but keeps the fixes to the license header comments. Change-Id: I4f08a9f3daf65d17b4c78ac6f4ac3de234ec3436 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/57366 Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com> Auto-Submit: David Benjamin <davidben@google.com>
2023-01-31Mark standalone Go scripts with go:build ignoreDavid Benjamin1-0/+2
gopls currently litters our project with a sea of red, because it assumes Go files are part of a package, but we have a lot of standalone Go scripts. (If there are C files in the same directory as the script, it gets upset about cgo. If there are multiple standalone scripts in the same directory, it gets uspet about duplicate files.) Per https://github.com/golang/go/issues/49657 and https://github.com/golang/tools/blob/master/gopls/doc/settings.md#standalonetags-string, the convention seems to be a go:build ignore tag. Newer versions of gopls run in a "standalone" mode, so we still get all the nice LSP features. As part of this, I had to align the license header comments from /* block comments */ to // line comments. Go build constraints can only be preceded by blank lines and line comments. Block comments apparently aren't allowed. (See https://pkg.go.dev/cmd/go#hdr-Build_constraints.) If I leave the file unconverted, go fmt will immediately move the comment to above the license block. Change-Id: I47c69255522e9aae2bdb97a6e83fcc6ce0cf29d5 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/56525 Commit-Queue: Adam Langley <agl@google.com> Reviewed-by: Adam Langley <agl@google.com> Auto-Submit: David Benjamin <davidben@google.com>
2020-06-12Reword some comments.David Benjamin1-2/+2
There were a handful of comments that use "blacklist" and "whitelist". They are easy to fix. Change-Id: I49a9592393b43fc85e92b4a00a585b504dede75a Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/41645 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2018-11-27Make symbol-prefixing work on 32-bit x86.David Benjamin1-1/+1
On Linux, this introduces yet another symbol to blacklist. Change-Id: Ieafe45a25f3b41da6c6934dd9488f4ee400bcab9 Reviewed-on: https://boringssl-review.googlesource.com/c/33350 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
2018-11-27Make Windows symbol-prefixing work.David Benjamin1-5/+84
This teaches read_symbols.go to use debug/pe, and fixes miscellaneous issues with NASM. It also reveals a problem with this strategy of getting symbols out at the linker level: inline functions. I'm thinking a better long-term mechanism may be to parse our header files. Change-Id: I11b008543a7a97db3db9d4062ee4ddb910d174b7 Reviewed-on: https://boringssl-review.googlesource.com/c/33349 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
2018-11-27Move __.SYMDEF handling to ar.go.David Benjamin1-3/+0
One less bit of special-casing in read_symbols.go. We filter out the sysv-style symbol table, so we should filter out the macOS one too. Add tests for util/ar to cover this and the Linux case. Change-Id: Id16d8b0526c1b6e0149df1df4006848d7b3a4b2f Reviewed-on: https://boringssl-review.googlesource.com/c/33347 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
2018-11-27Don't double-mangle C++ symbols on macOS.David Benjamin1-5/+1
The symbol-listing code already removes the leading underscore. Change-Id: I2f93382af932e8027f2aa8596886ba685836b3a6 Reviewed-on: https://boringssl-review.googlesource.com/c/33345 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
2018-11-27Make read_symbols.go a bit more idiomatic.David Benjamin1-32/+52
It's more verbose, but trimming the panics should make it easier to move to a library (e.g. a symbol checker) or unit test later. Change-Id: Iab37eff2689955e58057528be092d6dd5d8d26bc Reviewed-on: https://boringssl-review.googlesource.com/c/33344 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2018-09-24Add util/read_symbols.goJoshua Liebow-Feeser1-0/+170
- Add util/read_symbols.go to read exported symbols from an AR file for use with the symbol prefixing feature - Move util/fipstools/fipscommon/ar.go -> util/ar/ar.go - util/ar/ar.go: Support BSD-style AR files Change-Id: I171b3b952e69c4b87ac04751b7dba3ea9bc2504e Reviewed-on: https://boringssl-review.googlesource.com/32024 Reviewed-by: David Benjamin <davidben@google.com>