Skip to content

Instantly share code, notes, and snippets.

@Foxboron
Last active February 23, 2021 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Foxboron/94163c11a2c43ab523d3bc5597e4c49d to your computer and use it in GitHub Desktop.
Save Foxboron/94163c11a2c43ab523d3bc5597e4c49d to your computer and use it in GitHub Desktop.
Go-no
λ fzf » export CGO_LDFLAGS="-Wl,-z,relro,-z,now"
λ fzf » export CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2"
λ fzf » export GOFLAGS="-trimpath -ldflags=-linkmode=external"
λ fzf » CGO_ENABLED=1 go build -buildmode=pie -o fzf
^ - No File!
# github.com/junegunn/fzf
loadinternal: cannot find runtime/cgo
λ fzf » checksec --file=./fzf
RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE
Partial RELRO No canary found NX enabled PIE enabled No RPATH No RUNPATH 4594) Symbols No 0 0 ./fzf
^^^^^^^^^^^^^ ^^
λ fzf » CGO_ENABLED=1 go build -buildmode=pie -o fzf main.go
^^^^^^^
λ fzf » checksec --file=./fzf
RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE
Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH 4692) Symbols Yes 2 2 ./fzf
^^^^^^^^^^ ^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment