From 9637d8a253493be471d9a71640e91349f7a8a050 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 29 Jul 2015 11:57:54 -0700 Subject: Extend local PLT reference check On x86, linker in binutils 2.26 and newer consolidates R_*_JUMP_SLOT with R_*_GLOB_DAT relocation against the same symbol. This patch extends local PLT reference check to support alternate relocations. [BZ #18078] * scripts/check-localplt.awk: Support alternate relocations. * scripts/localplt.awk: Also check relocations in DT_RELA/DT_REL sections. * sysdeps/unix/sysv/linux/i386/localplt.data: Mark free and malloc entries with + REL R_386_GLOB_DAT. * sysdeps/x86_64/localplt.data: New file. --- sysdeps/unix/sysv/linux/i386/localplt.data | 8 +++++--- sysdeps/x86_64/localplt.data | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 sysdeps/x86_64/localplt.data (limited to 'sysdeps') diff --git a/sysdeps/unix/sysv/linux/i386/localplt.data b/sysdeps/unix/sysv/linux/i386/localplt.data index b25abf8..2e03821 100644 --- a/sysdeps/unix/sysv/linux/i386/localplt.data +++ b/sysdeps/unix/sysv/linux/i386/localplt.data @@ -1,7 +1,9 @@ +# Linker in binutils 2.26 and newer consolidates R_X86_64_JUMP_SLOT +# relocation with R_386_GLOB_DAT relocation against the same symbol. libc.so: _Unwind_Find_FDE libc.so: calloc -libc.so: free -libc.so: malloc +libc.so: free + REL R_386_GLOB_DAT +libc.so: malloc + REL R_386_GLOB_DAT libc.so: memalign libc.so: realloc libm.so: matherr @@ -12,4 +14,4 @@ ld.so: __libc_memalign ld.so: malloc ld.so: calloc ld.so: realloc -ld.so: free +ld.so: free + REL R_386_GLOB_DAT diff --git a/sysdeps/x86_64/localplt.data b/sysdeps/x86_64/localplt.data new file mode 100644 index 0000000..d140476 --- /dev/null +++ b/sysdeps/x86_64/localplt.data @@ -0,0 +1,19 @@ +# See scripts/check-localplt.awk for how this file is processed. +# PLT use is required for the malloc family and for matherr because +# users can define their own functions and have library internals call them. +# Linker in binutils 2.26 and newer consolidates R_X86_64_JUMP_SLOT +# relocation with R_X86_64_GLOB_DAT relocation against the same symbol. +libc.so: calloc +libc.so: free + RELA R_X86_64_GLOB_DAT +libc.so: malloc + RELA R_X86_64_GLOB_DAT +libc.so: memalign +libc.so: realloc +libm.so: matherr +# The dynamic loader uses __libc_memalign internally to allocate aligned +# TLS storage. The other malloc family of functions are expected to allow +# user symbol interposition. +ld.so: __libc_memalign +ld.so: malloc +ld.so: calloc +ld.so: realloc +ld.so: free + RELA R_X86_64_GLOB_DAT -- cgit v1.1