]> sourceware.org Git - glibc.git/commitdiff
Don't use INTDEF/INTUSE with _dl_init (bug 14132).
authorJoseph Myers <joseph@codesourcery.com>
Tue, 4 Nov 2014 23:26:39 +0000 (23:26 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 4 Nov 2014 23:26:39 +0000 (23:26 +0000)
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch eliminates its use for _dl_init.  Since _dl_init was already
declared with hidden visibility, creating a second hidden alias for it
was completely pointless, so this patch replaces all uses of
_dl_init_internal with plain _dl_init instead of using hidden_proto /
hidden_def (which are only needed when you want a hidden alias for a
non-hidden symbol; it's quite possible there are cases where they are
used but don't need to be because the symbol in question is not part
of the public ABI and is only used within a single library, so using
attributes_hidden instead would suffice).

Tested for x86_64 that installed stripped shared libraries are
unchanged by the patch.

[BZ #14132]
* elf/dl-init.c (_dl_init): Don't use INTDEF.
* sysdeps/aarch64/dl-machine.h (RTLD_START): Use _dl_init instead
of _dl_init_internal.
* sysdeps/alpha/dl-machine.h (RTLD_START): Likewise.
* sysdeps/arm/dl-machine.h (RTLD_START): Likewise.
* sysdeps/hppa/dl-machine.h (RTLD_START): Likewise.
* sysdeps/i386/dl-machine.h (RTLD_START): Likewise.
* sysdeps/ia64/dl-machine.h (RTLD_START): Likewise.
* sysdeps/m68k/dl-machine.h (RTLD_START): Likewise.
* sysdeps/microblaze/dl-machine.h (RTLD_START): Likewise.
* sysdeps/mips/dl-machine.h (RTLD_START): Likewise.
* sysdeps/powerpc/powerpc32/dl-start.S (_start): Likewise.
* sysdeps/s390/s390-32/dl-machine.h (RTLD_START): Likewise.
* sysdeps/s390/s390-64/dl-machine.h (RTLD_START): Likewise.
* sysdeps/sh/dl-machine.h (RTLD_START): Likewise.
* sysdeps/sparc/sparc32/dl-machine.h (RTLD_START): Likewise.
* sysdeps/sparc/sparc64/dl-machine.h (RTLD_START): Likewise.
* sysdeps/tile/dl-start.S (_start): Likewise.
* sysdeps/x86_64/dl-machine.h (RTLD_START): Likewise.
* sysdeps/x86_64/x32/dl-machine.h (RTLD_START): Likewise.

20 files changed:
ChangeLog
elf/dl-init.c
sysdeps/aarch64/dl-machine.h
sysdeps/alpha/dl-machine.h
sysdeps/arm/dl-machine.h
sysdeps/hppa/dl-machine.h
sysdeps/i386/dl-machine.h
sysdeps/ia64/dl-machine.h
sysdeps/m68k/dl-machine.h
sysdeps/microblaze/dl-machine.h
sysdeps/mips/dl-machine.h
sysdeps/powerpc/powerpc32/dl-start.S
sysdeps/s390/s390-32/dl-machine.h
sysdeps/s390/s390-64/dl-machine.h
sysdeps/sh/dl-machine.h
sysdeps/sparc/sparc32/dl-machine.h
sysdeps/sparc/sparc64/dl-machine.h
sysdeps/tile/dl-start.S
sysdeps/x86_64/dl-machine.h
sysdeps/x86_64/x32/dl-machine.h

index 3fa753b6823419f62ecc1a12338ba5ddcde69dcc..21cf47f55291ad45748a1b9c5b023fda120902a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2014-11-04  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #14132]
+       * elf/dl-init.c (_dl_init): Don't use INTDEF.
+       * sysdeps/aarch64/dl-machine.h (RTLD_START): Use _dl_init instead
+       of _dl_init_internal.
+       * sysdeps/alpha/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/arm/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/hppa/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/i386/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/ia64/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/m68k/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/microblaze/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/mips/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/powerpc/powerpc32/dl-start.S (_start): Likewise.
+       * sysdeps/s390/s390-32/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/s390/s390-64/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/sh/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/sparc/sparc32/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/sparc/sparc64/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/tile/dl-start.S (_start): Likewise.
+       * sysdeps/x86_64/dl-machine.h (RTLD_START): Likewise.
+       * sysdeps/x86_64/x32/dl-machine.h (RTLD_START): Likewise.
+
        [BZ #14132]
        * sysdeps/generic/ldsodefs.h (_dl_argv): Use rtld_hidden_proto.
        [IS_IN_rtld] (_dl_argv_internal): Do not declare.
index 598df3b4aad5d01ccaf1967e439f979ad29c7094..e5ade47acce3467029a8d689d94cecfdfeb6f01c 100644 (file)
@@ -130,4 +130,3 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env)
   INTUSE(_dl_starting_up) = 0;
 #endif
 }
-INTDEF (_dl_init)
index 6615b8f8575eb46ebe6efb368074c74047154b1a..674643781bb4dddbae86d4b2d887dd3e283ce4f7 100644 (file)
@@ -178,7 +178,7 @@ _dl_start_user:                                                     \n\
        adrp    x16, _rtld_local                                \n\
         add    x16, x16, #:lo12:_rtld_local                    \n\
         ldr    x0, [x16]                                       \n\
-       bl      _dl_init_internal                               \n\
+       bl      _dl_init                                        \n\
        // load the finalizer function                          \n\
        adrp    x0, _dl_fini                                    \n\
        add     x0, x0, #:lo12:_dl_fini                         \n\
index 64385ad68abcbacd4aefb50f4c02dc8d0e054a2b..b350b9ce4e708191281b9620ec2e9a8dbc2b21c1 100644 (file)
@@ -173,7 +173,7 @@ $fixup_stack_ret:                                           \n\
        lda     $18, 8($sp)                                     \n\
        s8addq  $17, 8, $19                                     \n\
        addq    $19, $18, $19                                   \n\
-       bsr     $26, _dl_init_internal  !samegp                 \n\
+       bsr     $26, _dl_init           !samegp                 \n\
        /* Pass our finalizer function to the user in $0. */    \n\
        ldah    $0, _dl_fini($gp)       !gprelhigh              \n\
        lda     $0, _dl_fini($0)        !gprellow               \n\
index 31a92513ea6ba0e38619e190bb6951d818fdfeaa..33ea2f637e4c0ebf616560dbea4afd20e95d6a40 100644 (file)
@@ -170,7 +170,7 @@ _dl_start_user:\n\
        ldr     r0, .L_LOADED\n\
        ldr     r0, [sl, r0]\n\
        @ call _dl_init\n\
-       bl      _dl_init_internal(PLT)\n\
+       bl      _dl_init(PLT)\n\
        @ load the finalizer function\n\
        ldr     r0, .L_FINI_PROC\n\
        add     r0, sl, r0\n\
index 9c7471e938ae3c657e6dbd56550efb1951bbeb06..9a9fe44c768894ac767976ac83a8b354b930f03b 100644 (file)
@@ -432,7 +432,7 @@ asm (                                                                       \
                                                                        \
        /* envp = argv + argc + 1 */                                    \
 "      sh2add  %r25,%r24,%r23\n"                                       \
-"      bl      _dl_init_internal,%r2\n"                                \
+"      bl      _dl_init,%r2\n"                                         \
 "      ldo     4(%r23),%r23\n" /* delay slot */                        \
                                                                        \
        /* Reload argc, argv to the registers start.S expects.  */      \
index a3a632cda28e1cbb13dbf25dc1dc52c19982f219..c10b1e56370e6a45ef93aef3bfd318295ff83593 100644 (file)
@@ -221,7 +221,7 @@ _dl_start_user:\n\
        # Clear %ebp, so that even constructors have terminated backchain.\n\
        xorl %ebp, %ebp\n\
        # Call the function to run the initializers.\n\
-       call _dl_init_internal@PLT\n\
+       call _dl_init@PLT\n\
        # Pass our finalizer function to the user in %edx, as per ELF ABI.\n\
        leal _dl_fini@GOTOFF(%ebx), %edx\n\
        # Restore %esp _start expects.\n\
index 7d3be0487f004e006e9e57d3bf8fdc57c24482b9..39d918aaed6a240b5ae894fb31eefc52746d00f6 100644 (file)
@@ -271,7 +271,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 "      }\n"                                                                  \
 "      { .mmb\n"                                                             \
 "        st8 [r2] = r17                /* Load the new _dl_argv. */\n"       \
-"        br.call.sptk.many b0 = _dl_init_internal#\n"                        \
+"        br.call.sptk.many b0 = _dl_init#\n"                                 \
 "        ;;\n"                                                               \
 "      }\n"                                                                  \
 "      /* Pass our finalizer function to the user,\n"                        \
index 4e7c7db846ad6da3b44c08a213e408d7b70fe6ce..cc4bebb800ac35d84c0c9f2b3927c1d2e2e68af8 100644 (file)
@@ -149,7 +149,7 @@ _dl_start_user:\n\
        pea 8(%sp)\n\
        move.l %d1, -(%sp)\n\
        " PCREL_OP ("move.l", "_rtld_local", "-(%sp)", "%d0", "%pc") "\n\
-       jbsr _dl_init_internal@PLTPC\n\
+       jbsr _dl_init@PLTPC\n\
        addq.l #8, %sp\n\
        addq.l #8, %sp\n\
        | Pass our finalizer function to the user in %a1.\n\
index d230a1b4e3babf533aa62fe6ac173f46e8d441da..102c6bbd4f3c97504e81fec26799247acca8e1af 100644 (file)
@@ -129,7 +129,7 @@ _dl_start_user:\n\
        addk  r8,r7,r5\n\
        addik r8,r8,4\n\
        lwi   r5,r20,_rtld_local@GOTOFF\n\
-       brlid r15,_dl_init_internal\n\
+       brlid r15,_dl_init\n\
        nop\n\
        lwi   r5,r1,24\n\
        lwi   r3,r1,20\n\
index eef0384e4e076bfec7101a145b498e4570850852..5000d2a300ba32486689dc7b4d036b3aaf6b1abe 100644 (file)
@@ -295,14 +295,14 @@ do {                                                                      \
        sll $7, $5, " STRINGXP (PTRLOG) "\n\
        " STRINGXP(PTR_ADDU) " $7, $7, $6\n\
        " STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\
-       # Make sure the stack pointer is aligned for _dl_init_internal.\n\
+       # Make sure the stack pointer is aligned for _dl_init.\n\
        and $2, $29, -2 * " STRINGXP(SZREG) "\n\
        move $8, $29\n\
        " STRINGXP(PTR_SUBIU) " $29, $2, 32\n\
        " STRINGXP(PTR_S) " $8, (32 - " STRINGXP(SZREG) ")($29)\n\
        " STRINGXP(SAVE_GP(16)) "\n\
        # Call the function to run the initializers.\n\
-       jal _dl_init_internal\n\
+       jal _dl_init\n\
        # Restore the stack pointer for _start.\n\
        " STRINGXP(PTR_L)  " $29, (32 - " STRINGXP(SZREG) ")($29)\n\
        # Pass our finalizer function to the user in $2 as per ELF ABI.\n\
@@ -371,7 +371,7 @@ do {                                                                        \
        sll $7, $5, " STRINGXP (PTRLOG) "\n\
        addu $7, $6\n\
        addu $7, " STRINGXP (PTRSIZE) "\n\
-       # Make sure the stack pointer is aligned for _dl_init_internal.\n\
+       # Make sure the stack pointer is aligned for _dl_init.\n\
        li $2, 2 * " STRINGXP (SZREG) "\n\
        neg $2, $2\n\
        move $3, $sp\n\
@@ -381,7 +381,7 @@ do {                                                                        \
        move $sp, $2\n\
        sw $16, 16($sp)\n\
        # Call the function to run the initializers.\n\
-       lw $2, %call16(_dl_init_internal)($16)\n\
+       lw $2, %call16(_dl_init)($16)\n\
        move $25, $2\n\
        jalr $2\n\
        # Restore the stack pointer for _start.\n\
index be8ce441ac9a65ff6c3b5c3a8199a324eb5e39f7..d54cd70f4441d5dbb85e3b196509ec8e0ad24b59 100644 (file)
@@ -63,7 +63,7 @@ _dl_start_user:
        slwi    r6,r4,2
        add     r6,r5,r6
        addi    r6,r6,4
-       bl      _dl_init_internal@local
+       bl      _dl_init@local
 
 /* Now, to conform to the ELF ABI, we have to: */
 /* Pass argc (actually _dl_argc) in r3; */
index 527233ba548863df9fc36871c5c3969c840557cc..c56185c538dc66302750a000c243a4ee09ed3fbd 100644 (file)
@@ -203,7 +203,7 @@ _dl_start_user:\n\
 .Llit:\n\
 .Ladr0: .long _GLOBAL_OFFSET_TABLE_-.Llit\n\
 .Ladr1: .long _dl_start-.Llit\n\
-.Ladr4: .long _dl_init_internal@PLT-.Llit\n\
+.Ladr4: .long _dl_init@PLT-.Llit\n\
 ");
 
 #ifndef RTLD_START_SPECIAL_INIT
index e48d355daac3fefb89f37c69703ba9473d87576a..463021c6a452b86f23b4479d352aa0d4359fbeb0 100644 (file)
@@ -175,7 +175,7 @@ _dl_start_user:\n\
        lgr   %r5,%r3\n\
        sllg  %r5,%r5,3\n\
        la    %r5,176(%r5,%r15)\n\
-       brasl %r14,_dl_init_internal@PLT\n\
+       brasl %r14,_dl_init@PLT\n\
        # Pass our finalizer function to the user in %r14, as per ELF ABI.\n\
        lghi  %r14,_dl_fini@GOT\n\
        lg    %r14,0(%r14,%r12)\n\
index 81a417d9aaa5c0598de2399e74dff069eaddc6cd..daac99d29872bd3d96fffdc55767c52a7c24e719 100644 (file)
@@ -188,7 +188,7 @@ _dl_start_user:\n\
 .L_dl_skip_args:\n\
        .long _dl_skip_args@GOT\n\
 .L_dl_init:\n\
-       .long _dl_init_internal@PLT\n\
+       .long _dl_init@PLT\n\
 .L_dl_loaded:\n\
        .long _rtld_local@GOT\n\
 .L_dl_fini:\n\
index 4b79cd69fc3f2f53896aaded4b3dbce0b5bea875..a24d5727b98e892eb550f0b26cb885fb10b666a2 100644 (file)
@@ -282,7 +282,7 @@ _dl_start_user:\n\
        add     %o3, 4, %o3\n\
        mov     %i5, %o1\n\
        add     %o2, %o3, %o3\n\
-       call    _dl_init_internal\n\
+       call    _dl_init\n\
         ld     [%o0], %o0\n\
   /* Pass our finalizer function to the user in %g1.  */\n\
        " RTLD_GOT_ADDRESS(%l7, %g1, _dl_fini) "\n\
index d6d263e96c89818ba21492c6e6d9afc26e3b5168..c9ee83520cebcde0b181e87451a59722f6a70369 100644 (file)
@@ -333,7 +333,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 "      add     %o3, 8, %o3\n"                                          \
 "      mov     %i5, %o1\n"                                             \
 "      add     %o2, %o3, %o3\n"                                        \
-"      call    _dl_init_internal\n"                                    \
+"      call    _dl_init\n"                                             \
 "       ldx    [%o0], %o0\n"                                           \
 "   /* Pass our finalizer function to the user in %g1.  */\n"          \
        RTLD_GOT_ADDRESS(%l7, %g1, _dl_fini)                            \
index d13f6096dc6ed68100987cc8b464b2b4b7fbe811..5a8876e49af67f91ba63c42dea49527374ea38ad 100644 (file)
@@ -94,7 +94,7 @@ ENTRY (_start)
        }
        {
         SHL_PTR_ADD r3, r3, r2  /* point r3 at envp */
-        jal _dl_init_internal
+        jal _dl_init
        }
 
        /* Call user program whose address we saved in r50.
index f9ee1f79b65887f128f21238c24d4ff9bb6ee4b7..8316f13a06b58d97c60cfdff2ebdc365b521cd2e 100644 (file)
@@ -145,7 +145,7 @@ _dl_start_user:\n\
        movq %rdx, %rsi\n\
        # Save %rsp value in %r13.\n\
        movq %rsp, %r13\n\
-       # And align stack for the _dl_init_internal call. \n\
+       # And align stack for the _dl_init call. \n\
        andq $-16, %rsp\n\
        # _dl_loaded -> rdi\n\
        movq _rtld_local(%rip), %rdi\n\
@@ -156,7 +156,7 @@ _dl_start_user:\n\
        # Clear %rbp to mark outermost frame obviously even for constructors.\n\
        xorl %ebp, %ebp\n\
        # Call the function to run the initializers.\n\
-       call _dl_init_internal@PLT\n\
+       call _dl_init@PLT\n\
        # Pass our finalizer function to the user in %rdx, as per ELF ABI.\n\
        leaq _dl_fini(%rip), %rdx\n\
        # And make sure %rsp points to argc stored on the stack.\n\
index 3ee41cf4a4027fa0eddf3e3793c8cea79ad4b82e..433435e870ac0de4f3086db68c89a6c37fc9d3c0 100644 (file)
@@ -62,7 +62,7 @@ _dl_start_user:\n\
        movl %edx, %esi\n\
        # Save %rsp value in %r13.\n\
        movl %esp, %r13d\n\
-       # And align stack for the _dl_init_internal call.\n\
+       # And align stack for the _dl_init call.\n\
        and $-16, %esp\n\
        # _dl_loaded -> rdi\n\
        movl _rtld_local(%rip), %edi\n\
@@ -73,7 +73,7 @@ _dl_start_user:\n\
        # Clear %rbp to mark outermost frame obviously even for constructors.\n\
        xorl %ebp, %ebp\n\
        # Call the function to run the initializers.\n\
-       call _dl_init_internal\n\
+       call _dl_init\n\
        # Pass our finalizer function to the user in %rdx, as per ELF ABI.\n\
        lea _dl_fini(%rip), %edx\n\
        # And make sure %rsp points to argc stored on the stack.\n\
This page took 0.133822 seconds and 5 git commands to generate.