Skip to content

Commit

Permalink
Use static-pie to benefit from full ASLR
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 623158855
Change-Id: Ibe6b77e45b78b1b46191876aedc35f9dd6d034ec
  • Loading branch information
Liblor authored and Copybara-Service committed Apr 9, 2024
1 parent 0b1b48c commit 3191d1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sandboxed_api/sandbox2/examples/static/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ cc_binary(
name = "static_bin",
srcs = ["static_bin.cc"],
copts = sapi_platform_copts(),
features = [
"-pie",
"fully_static_link", # link libc statically
linkopts = [
"-static-pie",
"-fuse-ld=bfd",
],
linkstatic = 1,
)
Expand Down
2 changes: 1 addition & 1 deletion sandboxed_api/sandbox2/examples/static/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ set_target_properties(sandbox2_static_bin PROPERTIES OUTPUT_NAME static_bin)
add_executable(sandbox2::static_bin ALIAS sandbox2_static_bin)
target_link_libraries(sandbox2_static_bin PRIVATE
sapi::base
-static # Fully static link
-static-pie # Fully static link
)

0 comments on commit 3191d1e

Please sign in to comment.