-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
Team:Cloud SecurityCloud Security team relatedCloud Security team relatedbugSomething isn't workingSomething isn't working
Description
Describe the bug
DCE (dead code elimination) is being disabled because of problematic use of reflection. This should be a bug for any production binary.
deadcode being included is significantly the binary size and makes it even harder to reduce it.
Preconditions
none
To Reproduce
- build the binary (a marker unused method can be added to prove DCE is disabled)
Expected behavior
deadcode is not included in the binary
References
- https://golab.io/talks/getting-the-most-out-of-dead-code-elimination
- https://github.com/aarzilli/whydeadcode
- https://pkg.go.dev/reflect#Value.MethodByName
Calling this method will cause the linker to retain all methods with this name in all packages. If the linker can't determine the name, it will retain all exported methods. This may make the executable binary larger but will not affect execution time.
Metadata
Metadata
Assignees
Labels
Team:Cloud SecurityCloud Security team relatedCloud Security team relatedbugSomething isn't workingSomething isn't working