Repository navigation
Enable BIND_NOW by default for ELF binaries - #2677
Merged
Merged
Conversation
Enable immediate function binding by default with the existing internal and external linker support, preserving -bindnow=false. Extend ELF binding and RELRO coverage, and document the new default and Microsoft security-policy rationale. Fixes #851. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The missing upstream Go submodule prevents inspection of the existing ELF linker and complete test harness needed to validate this cross-platform security-default change.
No open issues 🎉
What changed in this PR
Enables immediate symbol binding (BIND_NOW) by default for dynamically linked ELF outputs in the Microsoft build of Go, addressing #851 and aligning with Microsoft security policies.
Changes:
- Changes the linker default while preserving
-bindnow=falseand leaving static and non-ELF behavior unchanged. - Extends regression coverage for binding flags, RELRO, and shared libraries.
- Documents the Go 1.28 behavior and opt-out instructions.
Patches are happy!
| File | Description |
|---|---|
patches/index.json |
Registers the new patch and refreshes patch metadata. |
patches/0015-Enable-BIND_NOW-by-default.patch |
Enables the default and updates linker documentation and regression tests. |
eng/doc/MigrationGuide.md |
Adds migration guidance and the opt-out flag. |
eng/doc/AdditionalFeatures.md |
Explains immediate binding, its scope, and how to disable it. |
docs/go1.28.md |
Announces the new default in the release notes. |
Review effort: Balanced
Ubuntu GCC enables immediate binding by default, so -bindnow=false alone does not clear the ELF NOW flags. Give external-link tests a lazy-binding baseline through -extld before Go adds its own flags. This keeps both enablement and opt-out checks meaningful without passing linker-only options to C compilation. Clarify that the external C toolchain can still enable immediate binding independently. Verified all binding cases with GCC and Clang, with and without system crypto, in the Ubuntu CI image. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
George Adams (gdams)
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-bindnow=falseand leave static binaries and non-ELF behavior unchanged.Fixes #851.
Validation