diff --git a/glibc.spec b/glibc.spec index 515dd528c6768435d0dc12f1c608bad6bbf3b3f1..3cbb20a66120f00e5d1b7db26f8cf27e8b5119b6 100644 --- a/glibc.spec +++ b/glibc.spec @@ -66,7 +66,7 @@ ############################################################################## Name: glibc Version: 2.34 -Release: 121 +Release: 122 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -306,6 +306,7 @@ Patch9035: 0003-elf-ld.so-remove-_mmap_hole-when-ld.so-mmap-PT_LOAD-.patch Patch9036: elf-ld.so-add-MAP_NORESERVE-flag-for-the-first-mmap-2MB-contig.patch Patch9037: elf-ld.so-prohibit-multiple-i-options-and-do-not-allow-i-speci.patch Patch9038: elf-ld.so-Consider-maybe-existing-hole-between-PT_LO.patch +Patch9039: sysboost-Retain-relocation-information-of-libc.patch Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) @@ -1497,6 +1498,9 @@ fi %{_libdir}/ld.so.relocation %changelog +* Mon Jun 5 2023 Zhou Kang - 2.34-122 +- add relocation + * Fri May 19 2023 Qingqing Li - 2.34-121 - locale: reduce the size of locale C.utf-8 diff --git a/sysboost-Retain-relocation-information-of-libc.patch b/sysboost-Retain-relocation-information-of-libc.patch new file mode 100644 index 0000000000000000000000000000000000000000..ee12f8ddf96c2b470ce9a392a4d0b209c06fda9f --- /dev/null +++ b/sysboost-Retain-relocation-information-of-libc.patch @@ -0,0 +1,39 @@ +diff --git a/Makerules b/Makerules +index 596fa683..cf2c980d 100644 +--- a/Makerules ++++ b/Makerules +@@ -537,7 +537,7 @@ lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(link-libc-deps) + $(call after-link,$@) + + define build-shlib-helper +-$(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) \ ++$(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) -Wl,--emit-relocs \ + $(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) $(rtld-LDFLAGS) \ + $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \ + $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \ +@@ -554,7 +554,7 @@ else + # binutils only position loadable notes into the first page for binaries, + # not for shared objects + $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules +- $(LINK.o) -shared -Wl,-O1 \ ++ $(LINK.o) -shared -Wl,-O1 -Wl,--emit-relocs \ + -nostdlib -nostartfiles \ + $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \ + -Wl,--verbose 2>/dev/null | \ +diff --git a/elf/Makefile b/elf/Makefile +index d05f4105..9d38e268 100644 +--- a/elf/Makefile ++++ b/elf/Makefile +@@ -602,10 +602,11 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) + # Link into a temporary file so that we don't touch $@ at all + # if the sanity check below fails. + $(LINK.o) -nostdlib -nostartfiles -shared -o $@.new \ +- $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \ ++ $(LDFLAGS-rtld) -Wl,--emit-relocs -Wl,-z,defs $(z-now-$(bind-now)) \ + $(filter-out $(map-file),$^) $(load-map-file) \ + -Wl,-soname=$(rtld-installed-name) \ + -Wl,-defsym=_begin=0 ++ cp -f $@.new ld-relocation + $(call after-link,$@.new) + $(READELF) -s $@.new \ + | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'