diff options
author | Alan Modra <amodra@gmail.com> | 2022-04-27 14:39:10 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-04-28 08:50:11 +0930 |
commit | 6f043e0ee7e477f50a44024ed0cb579d5e3f511d (patch) | |
tree | 4529aa08035a4e795b1f18daf7f42f67c9db143e /elf/Makefile | |
parent | 911c63a51c690dd1a97dfc587097277029baf00f (diff) | |
download | glibc-6f043e0ee7e477f50a44024ed0cb579d5e3f511d.zip glibc-6f043e0ee7e477f50a44024ed0cb579d5e3f511d.tar.gz glibc-6f043e0ee7e477f50a44024ed0cb579d5e3f511d.tar.bz2 |
Use __ehdr_start rather than _begin in _dl_start_final
__ehdr_start is already used in rltld.c:dl_main, and can serve the
same purpose as _begin. Besides tidying the code, using linker
defined section relative symbols rather than "-defsym _begin=0" better
reflects the intent of _dl_start_final use of _begin, which is to
refer to the load address of ld.so rather than absolute address zero.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'elf/Makefile')
-rw-r--r-- | elf/Makefile | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/elf/Makefile b/elf/Makefile index 80e8552..fc9860e 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1336,8 +1336,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) $(LINK.o) -nostdlib -nostartfiles -shared -o $@.new \ $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \ $(filter-out $(map-file),$^) $(load-map-file) \ - -Wl,-soname=$(rtld-installed-name) \ - -Wl,-defsym=_begin=0 + -Wl,-soname=$(rtld-installed-name) $(call after-link,$@.new) $(READELF) -s $@.new \ | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' |