fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
747 B21 linesraw
1-include ../tools.mk
2
3# only-linux
4#
5# This tests the different -Zrelro-level values, and makes sure that they work properly.
6
7all:
8	# Ensure that binaries built with the full relro level links them with both
9	# RELRO and BIND_NOW for doing eager symbol resolving.
10	$(RUSTC) -Zrelro-level=full hello.rs
11	readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO
12	readelf -d $(TMPDIR)/hello | grep -q BIND_NOW
13
14	$(RUSTC) -Zrelro-level=partial hello.rs
15	readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO
16
17	# Ensure that we're *not* built with RELRO when setting it to off.  We do
18	# not want to check for BIND_NOW however, as the linker might have that
19	# enabled by default.
20	$(RUSTC) -Zrelro-level=off hello.rs
21	! readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO