2023-03-30 08:46:31 -05:00
|
|
|
# ignore-cross-compile
|
2022-08-22 19:00:00 -05:00
|
|
|
include ../tools.mk
|
2018-02-22 13:38:35 -06:00
|
|
|
|
2019-01-06 15:27:57 -06:00
|
|
|
# only-linux
|
|
|
|
#
|
2019-01-03 14:27:50 -06:00
|
|
|
# This tests the different -Zrelro-level values, and makes sure that they work properly.
|
2018-02-22 13:38:35 -06:00
|
|
|
|
|
|
|
all:
|
|
|
|
# Ensure that binaries built with the full relro level links them with both
|
|
|
|
# RELRO and BIND_NOW for doing eager symbol resolving.
|
|
|
|
$(RUSTC) -Zrelro-level=full hello.rs
|
|
|
|
readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO
|
|
|
|
readelf -d $(TMPDIR)/hello | grep -q BIND_NOW
|
|
|
|
|
|
|
|
$(RUSTC) -Zrelro-level=partial hello.rs
|
|
|
|
readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO
|
|
|
|
|
|
|
|
# Ensure that we're *not* built with RELRO when setting it to off. We do
|
|
|
|
# not want to check for BIND_NOW however, as the linker might have that
|
|
|
|
# enabled by default.
|
|
|
|
$(RUSTC) -Zrelro-level=off hello.rs
|
|
|
|
! readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO
|