cmd/link: when building with buildmode=pie
the DF_1_PIE flag should be added to the resulting elf
#46747
Labels
Milestone
What version of Go are you using (
go version
)?1.6.2
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Ubuntu 21.04 amd64
go env
OutputWhat did you do?
Built an executable file with
go build --buildmode=pie
and ranreadelf -d
to examine itWhat did you expect to see?
The flag DF_1_PIE in the section FLAGS_1
What did you see instead?
Nothing in FLAGS_1
This flag is relevant to how the
file
command determines the difference between shared objects and position independent executable files as documented here: https://cirosantilli.com/elf-hello-world/df-1-pie.The text was updated successfully, but these errors were encountered: