diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2022-05-16 06:17:14 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2022-05-18 13:04:13 -0700 |
commit | 2d5ec6692f5746ccb11db60976a6481ef8e9d74f (patch) | |
tree | 93ce3ec2b6d4fb72bcd3bac0432ea1405683c967 /Makerules | |
parent | S390: Enable static PIE (diff) | |
download | glibc-2d5ec6692f5746ccb11db60976a6481ef8e9d74f.tar.gz glibc-2d5ec6692f5746ccb11db60976a6481ef8e9d74f.tar.bz2 glibc-2d5ec6692f5746ccb11db60976a6481ef8e9d74f.zip |
Enable DT_RELR in glibc shared libraries and PIEs automatically
Enable DT_RELR in glibc shared libraries and position independent
executables (PIE) automatically if linker supports -z pack-relative-relocs.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'Makerules')
-rw-r--r-- | Makerules | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -536,6 +536,7 @@ lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(link-libc-deps) define build-shlib-helper $(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) \ $(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) $(rtld-LDFLAGS) \ + $(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(dt-relr-ldflag)) \ $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \ $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \ -Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \ @@ -588,6 +589,7 @@ endef define build-module-helper $(LINK.o) -shared -static-libgcc $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \ $(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) \ + $(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(dt-relr-ldflag)) \ -B$(csu-objpfx) $(load-map-file) \ $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \ $(link-test-modules-rpath-link) \ |