[PATCH 0/2] Remove more unnecessary PLT relocations in librtld.os
H.J. Lu
hjl.tools@gmail.com
Mon Dec 7 19:00:00 GMT 2015
Some internal functions in ld.so aren't marked as hidden and they are
called via PLT, which requires setting up PIC register and is expensive
on x86. This patch marks those internal function as hidden. There are
no regressions on i686 nor x86-64. Since sysdeps/mach/hurd/Versions has
ld {
GLIBC_2.0 {
# variables that must be shared with libc
__hurd_sigthread_stack_base; __hurd_sigthread_stack_end;
__hurd_sigthread_variables;
__hurd_threadvar_stack_mask; __hurd_threadvar_stack_offset;
# functions that must be shared with libc
__close; __getcwd; __getpid;
__mmap; __open; __xstat64; __fxstat64;
_exit; _hurd_intr_rpc_mach_msg;
abort;
}
GLIBC_2.2.6 {
# this also must be shared with libc.
__errno_location;
}
GLIBC_PRIVATE {
_dl_init_first;
# functions that must be shared with libc
__libc_read; __libc_write; __libc_lseek64;
}
}
we must keep PLT relocations against __mmap, __close, __getcwd,
__getpid, __libc_read and __libc_write when compiling for Hurd.
H.J. Lu (2):
Mark ld.so internal mmap functions hidden in ld.so
Mark internal unistd functions hidden in ld.so
include/sys/mman.h | 4 ++++
include/unistd.h | 6 +++++-
sysdeps/generic/dl-mman.h | 22 ++++++++++++++++++++++
sysdeps/generic/dl-unistd.h | 30 ++++++++++++++++++++++++++++++
sysdeps/mach/hurd/dl-mman.h | 23 +++++++++++++++++++++++
sysdeps/mach/hurd/dl-unistd.h | 25 +++++++++++++++++++++++++
6 files changed, 109 insertions(+), 1 deletion(-)
create mode 100644 sysdeps/generic/dl-mman.h
create mode 100644 sysdeps/generic/dl-unistd.h
create mode 100644 sysdeps/mach/hurd/dl-mman.h
create mode 100644 sysdeps/mach/hurd/dl-unistd.h
--
2.5.0
More information about the Libc-alpha
mailing list