Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: add -flat_namespace to LDFLAGS whitelist #26173

crawshaw opened this issue Jul 1, 2018 · 4 comments


None yet
4 participants
Copy link

commented Jul 1, 2018

The approximate macOS equivalent to linux's -Wl,--unresolved-symbols=ignore is -Wl,-undefined,suppress. It is whitelisted, but using it requires setting the linker flag -flat_namespace, which is not on the whitelist.

The Apple documentation reads:

            Alters how symbols are resolved at build time and runtime.  With
            -two_levelnamespace (the default), the linker only searches dylibs
            on the command line for symbols, and records in which dylib they
            were found.  With -flat_namespace, the linker searches all dylibs
            on the command line and all dylibs those original dylibs depend
            on.  The linker does not record which dylib an external symbol
            came from, so at runtime dyld again searches all images and uses
            the first definition it finds.  In addition, any undefines in
            loaded flat_namespace dylibs must be resolvable at build time.

I thought about it a bit and cannot see any way this can cause arbitrary code execution. Could it be included on the whitelist?


cc @ianlancetaylor


This comment has been minimized.

Copy link
Contributor Author

commented Jul 1, 2018

I would assign this the Go1.11 label as I would like to see it in the next release, but apparently I was removed from the go github organization. (Presumably some helpful shell script somewhere.)


This comment has been minimized.

Copy link

commented Jul 1, 2018

Change mentions this issue: cmd/go: add -flat_namespace to LDFLAGS whitelist

@mvdan mvdan added this to the Go1.11 milestone Jul 1, 2018


This comment has been minimized.

Copy link

commented Jul 1, 2018

@crawshaw I'm sure you'd be given full access to the issue tracker again if you filed an issue about it :)


This comment has been minimized.

Copy link

commented Jul 2, 2018

By the way, this is a thing now: @gopherbot please label NeedsFix. But looks like you have access again.

@gopherbot gopherbot added the NeedsFix label Jul 2, 2018

@gopherbot gopherbot closed this in 59934e7 Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.