H.J. Lu
58007e9e68
Make sure that calloc is called at least once
...
PLT relocations aren't required when -z now used. Linker on master with:
commit 25070364b0ce33eed46aa5d78ebebbec6accec7e
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat May 16 07:00:21 2015 -0700
Don't generate PLT relocations for now binding
There is no need for PLT relocations with -z now. We can use GOT
relocations, which take less space, instead and replace 16-byte .plt
entres with 8-byte .plt.got entries.
bfd/
* elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
for now binding.
(elf_i386_allocate_dynrelocs): Use .plt.got section for now
binding.
* elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
section for now binding.
(elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
binding.
won't generate PLT relocations with -z now. elf/tst-audit2.c expect
certain order of execution in ld.so. With PLT relocations, the GOTPLT
entry of calloc is update to calloc defined in tst-audit2:
(gdb) bt
skip_ifunc=<optimized out>, reloc_addr_arg=<optimized out>,
version=<optimized out>, sym=<optimized out>, map=<optimized out>)
at ../sysdeps/i386/dl-machine.h:329
out>,
nrelative=<optimized out>, relsize=<optimized out>,
reladdr=<optimized out>, map=<optimized out>) at do-rel.h:137
reloc_mode=reloc_mode@entry=0,
consider_profiling=1, consider_profiling@entry=0) at dl-reloc.c:258
user_entry=0xffffcf1c, auxv=0xffffd0a8) at rtld.c:2133
start_argptr=start_argptr@entry=0xffffcfb0,
dl_main=dl_main@entry=0xf7fda6f0 <dl_main>) at
../elf/dl-sysdep.c:249
from /export/build/gnu/glibc-32bit/build-i686-linux/elf/ld.so
(gdb)
and then calloc is called:
(gdb) c
Continuing.
Breakpoint 4, calloc (n=n@entry=20, m=4) at tst-audit2.c:18
18 {
(gdb) bt
reloc_mode=reloc_mode@entry=0, consider_profiling=1,
consider_profiling@entry=0) at dl-reloc.c:272
user_entry=0xffffcf1c, auxv=0xffffd0a8) at rtld.c:2133
start_argptr=start_argptr@entry=0xffffcfb0,
dl_main=dl_main@entry=0xf7fda6f0 <dl_main>) at
../elf/dl-sysdep.c:249
from /export/build/gnu/glibc-32bit/build-i686-linux/elf/ld.so
(gdb)
With GOT relocation, calloc in ld.so is called first:
(gdb) bt
consider_profiling=1) at dl-reloc.c:272
user_entry=0xffffcf0c, auxv=0xffffd098) at rtld.c:2074
start_argptr=start_argptr@entry=0xffffcfa0,
dl_main=dl_main@entry=0xf7fda6c0 <dl_main>) at
../elf/dl-sysdep.c:249
from /export/build/gnu/glibc-32bit-test/build-i686-linux/elf/ld.so
(gdb)
and then the GOT entry of calloc is updated:
(gdb) bt
skip_ifunc=<optimized out>, reloc_addr_arg=<optimized out>,
version=<optimized out>, sym=<optimized out>, map=<optimized out>)
at ../sysdeps/i386/dl-machine.h:329
out>,
nrelative=<optimized out>, relsize=<optimized out>,
reladdr=<optimized out>, map=<optimized out>) at do-rel.h:137
reloc_mode=reloc_mode@entry=0,
consider_profiling=1, consider_profiling@entry=0) at dl-reloc.c:258
user_entry=0xffffcf0c, auxv=0xffffd098) at rtld.c:2133
start_argptr=start_argptr@entry=0xffffcfa0,
dl_main=dl_main@entry=0xf7fda6c0 <dl_main>) at
../elf/dl-sysdep.c:249
from /export/build/gnu/glibc-32bit-test/build-i686-linux/elf/ld.so
(gdb)
After that, since calloc isn't called from ld.so nor any other modules,
magic in tst-audit2 isn't updated. Both orders are correct. This patch
makes sure that calloc in tst-audit2.c is called at least once from ld.so.
[BZ #18422 ]
* Makefile ($(objpfx)tst-audit2): Depend on $(libdl).
($(objpfx)tst-audit2.out): Also depend on
$(objpfx)tst-auditmod9b.so.
* elf/tst-audit2.c: Include <dlfcn.h>.
(calloc_called): New.
(calloc): Allow to be called more than once.
(do_test): dllopen/dlclose $ORIGIN/tst-auditmod9b.so.
2015-05-28 05:06:53 -07:00
..
2015-03-11 21:07:32 -04:00
2015-01-02 16:29:47 +00:00
2006-03-01 06:18:49 +00:00
2002-07-17 00:34:35 +00:00
2002-06-30 07:17:02 +00:00
2002-07-17 00:34:35 +00:00
2002-07-17 00:34:35 +00:00
2002-07-17 00:34:35 +00:00
2002-06-30 07:17:02 +00:00
2000-08-19 08:30:28 +00:00
2001-01-21 17:15:50 +00:00
2000-12-17 17:50:56 +00:00
2001-09-06 01:03:05 +00:00
2001-12-21 10:16:16 +00:00
2001-12-21 10:16:16 +00:00
2001-12-21 10:16:16 +00:00
2001-09-06 01:03:05 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2015-01-02 16:29:47 +00:00
2005-12-14 08:43:25 +00:00
2015-01-21 01:51:10 -05:00
2015-01-02 16:29:47 +00:00
2015-04-17 14:29:40 -07:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-25 15:12:10 +10:00
2015-01-02 16:29:47 +00:00
2015-03-31 05:16:57 -07:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-04-17 12:11:58 -07:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-05-22 17:46:58 -07:00
2015-01-02 16:29:47 +00:00
2005-12-14 08:43:25 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-03-17 00:31:49 -03:00
2005-12-14 08:43:25 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-03-25 15:53:47 +10:30
2015-05-01 22:48:19 +02:00
2015-01-02 16:29:47 +00:00
2000-12-17 17:50:56 +00:00
2000-08-19 07:17:09 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2001-02-06 10:38:10 +00:00
1999-05-03 21:59:35 +00:00
1998-03-05 16:42:56 +00:00
2015-01-02 16:29:47 +00:00
2001-03-21 07:21:34 +00:00
2001-04-06 15:23:41 +00:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2015-03-06 17:05:42 -08:00
2009-06-03 16:21:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2013-06-05 20:44:03 +00:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-06-22 15:07:40 -07:00
2013-06-05 20:44:03 +00:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-10-30 00:48:54 -07:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-11-06 09:30:56 -08:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-06-03 16:21:40 -07:00
2009-10-30 00:48:54 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-10-30 00:48:54 -07:00
2009-10-30 00:48:54 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2015-03-06 17:05:42 -08:00
2009-10-30 00:48:54 -07:00
2015-03-06 17:05:42 -08:00
2009-06-22 15:07:40 -07:00
2001-02-02 06:54:15 +00:00
2015-01-02 16:29:47 +00:00
2004-04-21 18:58:31 +00:00
2015-01-02 16:54:45 +00:00
2015-01-02 16:54:45 +00:00
2015-01-02 16:29:47 +00:00
2000-11-26 06:18:02 +00:00
2006-03-01 06:18:49 +00:00
2000-12-17 17:50:56 +00:00
2000-12-15 16:03:57 +00:00
2015-05-28 05:06:53 -07:00
2000-11-26 06:18:02 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-31 06:09:08 +00:00
2000-12-31 06:09:08 +00:00
2006-03-01 06:18:49 +00:00
2006-03-01 06:18:49 +00:00
2012-01-07 23:57:22 -05:00
2006-03-01 06:18:49 +00:00
2000-11-26 06:18:02 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2003-01-12 07:52:53 +00:00
2003-01-12 07:52:53 +00:00
2003-01-12 07:52:53 +00:00
2003-01-12 10:11:16 +00:00
2000-11-26 06:18:02 +00:00
2000-08-25 19:33:19 +00:00
2000-08-25 19:33:19 +00:00
2000-12-17 17:50:56 +00:00
2000-08-25 19:33:19 +00:00
2002-02-10 22:40:17 +00:00
2000-07-21 04:42:21 +00:00
2002-03-03 19:43:30 +00:00
2000-07-21 04:42:21 +00:00
2011-02-25 20:49:48 -05:00
2005-03-19 08:04:37 +00:00
2005-03-19 08:04:37 +00:00
2005-12-27 22:50:12 +00:00
2005-03-19 08:04:37 +00:00
2005-03-19 08:04:37 +00:00
2000-11-26 06:18:02 +00:00
2000-11-26 06:18:02 +00:00
2000-12-17 17:50:56 +00:00
2015-04-08 21:06:49 +02:00
2015-04-08 21:06:49 +02:00
2000-12-15 16:03:57 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2001-09-08 17:45:32 +00:00
2013-08-21 19:48:48 +02:00
2001-09-22 15:44:07 +00:00
2001-05-22 23:55:23 +00:00
2001-06-22 13:50:51 +00:00
2001-05-22 23:55:23 +00:00
2001-06-22 13:50:51 +00:00
2001-09-22 15:44:35 +00:00
2003-01-12 10:11:16 +00:00
2001-10-01 00:14:14 +00:00
2001-10-01 00:14:14 +00:00
2001-10-01 00:14:14 +00:00
2001-10-01 00:14:14 +00:00
2001-10-01 00:14:14 +00:00
2002-04-15 17:10:22 +00:00
2002-04-15 17:10:22 +00:00
2002-04-15 17:10:22 +00:00
2002-12-30 20:25:40 +00:00
2002-12-30 20:25:40 +00:00
2002-12-30 20:25:40 +00:00
2002-12-30 20:25:40 +00:00
2003-01-12 10:11:16 +00:00
2003-01-12 10:11:16 +00:00
2003-01-12 10:11:16 +00:00
2003-01-12 10:11:16 +00:00
2013-08-21 19:48:48 +02:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2001-12-21 10:16:16 +00:00
2001-12-21 10:16:16 +00:00
1999-08-02 19:56:07 +00:00
2000-11-26 06:18:02 +00:00
2001-05-22 22:30:18 +00:00
2012-07-27 14:03:20 +01:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2010-12-24 20:14:37 -05:00
2011-06-27 20:26:54 -07:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:54:45 +00:00
2015-02-25 00:04:55 -05:00
2015-01-02 16:29:47 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2005-03-06 00:08:10 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2013-06-05 20:44:03 +00:00
2012-07-17 11:30:58 +00:00
2015-03-17 00:31:49 -03:00
2006-08-31 17:16:11 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2005-02-14 21:25:50 +00:00
2012-11-16 07:40:38 -08:00
2002-11-07 22:28:16 +00:00
2002-11-07 22:28:16 +00:00
2002-11-07 22:28:16 +00:00
2012-11-16 07:40:38 -08:00
2002-11-07 22:28:16 +00:00
2003-01-27 21:03:22 +00:00
2003-01-27 21:03:22 +00:00
2005-07-07 23:00:02 +00:00
2005-07-07 23:00:02 +00:00
2005-07-07 23:00:02 +00:00
2005-07-07 23:00:02 +00:00
2005-07-07 23:00:02 +00:00
2005-01-06 22:40:27 +00:00
2015-05-28 05:06:53 -07:00
2012-11-14 15:44:40 -08:00
2014-02-25 13:18:15 -05:00
2012-07-26 11:29:07 +00:00
2014-02-25 13:18:15 -05:00
2014-02-25 13:18:15 -05:00
2015-01-02 16:29:47 +00:00
2004-09-23 07:45:38 +00:00
2004-09-23 07:45:38 +00:00
2004-09-23 07:45:38 +00:00
2004-09-23 07:45:38 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2004-10-14 02:08:23 +00:00
2004-10-27 20:27:40 +00:00
2004-10-14 02:08:23 +00:00
2004-10-28 06:53:20 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2003-09-23 12:07:26 +00:00
2003-09-23 12:07:26 +00:00
2003-09-24 01:56:08 +00:00
2012-05-26 09:48:26 +05:30
2014-11-05 15:24:08 +05:30
2011-08-22 16:08:16 -04:00
2011-08-22 16:08:16 -04:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2012-10-20 16:16:59 -07:00
2006-03-19 07:48:05 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2011-01-19 16:00:11 -05:00
2014-11-05 15:24:08 +05:30
2015-01-02 16:29:47 +00:00
2004-07-16 17:56:45 +00:00
2015-01-02 16:29:47 +00:00
2014-11-05 15:24:08 +05:30
2015-03-31 05:21:12 -07:00
2015-03-31 05:21:12 -07:00
2015-03-31 05:21:12 -07:00
2015-03-31 05:21:12 -07:00
2015-03-31 05:21:12 -07:00
2013-09-23 00:52:09 -04:00
2015-01-02 16:29:47 +00:00
2012-05-17 22:00:57 +02:00
2012-01-27 15:05:19 -05:00
2012-01-27 15:05:19 -05:00
2015-01-02 16:29:47 +00:00
2005-06-26 18:14:26 +00:00
2015-01-02 16:29:47 +00:00
2007-07-31 13:33:18 +00:00
2002-08-28 10:42:59 +00:00
2013-10-18 19:45:36 +05:30
2002-08-28 10:42:59 +00:00
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2002-10-22 06:22:38 +00:00
2013-10-18 19:45:36 +05:30
2014-11-05 15:24:08 +05:30
2013-10-18 19:45:36 +05:30
2014-11-05 15:24:08 +05:30
2014-11-05 15:24:08 +05:30
2005-12-27 22:29:27 +00:00
2013-10-18 19:45:36 +05:30
2005-03-20 22:25:59 +00:00
2008-01-17 20:20:00 +00:00
2008-10-17 15:24:10 +00:00
2008-10-31 20:50:16 +00:00
2011-05-14 21:25:43 -04:00
2011-05-14 21:25:43 -04:00
2011-05-14 21:25:43 -04:00
2011-05-14 21:25:43 -04:00
2013-10-18 19:45:36 +05:30
2015-05-06 13:32:18 -07:00
2015-05-06 13:32:18 -07:00
2015-05-06 13:32:18 -07:00
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2011-09-10 14:34:15 -04:00
2011-09-10 14:34:15 -04:00
2011-09-10 14:34:15 -04:00
2003-04-17 19:19:29 +00:00
2011-09-10 14:34:15 -04:00
2011-09-10 14:34:15 -04:00
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2003-07-24 20:07:00 +00:00
2005-03-20 22:25:59 +00:00
2011-09-10 14:34:15 -04:00
2013-10-18 19:45:36 +05:30
2013-10-18 19:45:36 +05:30
2008-10-17 15:24:10 +00:00
2008-10-17 15:24:10 +00:00
2008-10-31 20:50:16 +00:00
2009-07-23 07:07:53 -07:00
2012-08-02 21:04:29 +02:00
2012-08-02 21:04:29 +02:00
2009-07-09 23:52:22 -07:00
2012-08-02 21:04:29 +02:00
2012-08-02 21:04:29 +02:00
2012-01-25 16:50:17 +00:00
2011-03-10 12:51:33 -05:00
2012-01-25 16:50:17 +00:00
2012-01-25 16:50:17 +00:00
2012-01-25 16:50:17 +00:00
2011-05-12 21:59:09 -04:00
2014-12-16 10:26:48 +01:00
2006-03-01 06:18:49 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2005-03-03 08:28:23 +00:00
2005-03-03 08:28:23 +00:00
2005-03-03 08:28:23 +00:00
2005-03-03 08:28:23 +00:00
2005-03-06 00:08:10 +00:00
2005-03-18 10:54:53 +00:00
2005-03-18 10:54:53 +00:00
2005-03-18 10:54:53 +00:00
2005-03-18 10:54:53 +00:00
2005-03-18 10:54:53 +00:00
2005-03-18 10:54:53 +00:00
2005-04-27 01:39:11 +00:00
2005-04-27 01:39:11 +00:00
2005-04-27 01:39:11 +00:00
2005-04-27 01:39:11 +00:00
2006-09-19 14:42:12 +00:00
2006-09-19 14:42:12 +00:00
2006-09-19 14:42:12 +00:00
2011-08-24 09:32:13 +02:00
2011-08-24 09:32:13 +02:00
2011-08-24 09:32:13 +02:00
2011-08-24 09:32:13 +02:00
2011-08-24 09:32:13 +02:00
2006-03-01 06:18:49 +00:00
2000-08-26 23:41:19 +00:00
2014-03-25 21:54:09 +00:00
2015-02-27 14:13:28 -08:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2015-01-02 16:29:47 +00:00
2003-03-29 03:46:03 +00:00