]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
arc: Remove _dl_skip_args usage
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 26 May 2022 16:04:40 +0000 (13:04 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 30 May 2022 19:32:29 +0000 (16:32 -0300)
Since ad43cac44a the generic code already shuffles the argv/envp/auxv
on the stack to remove the ld.so own arguments and thus _dl_skip_args
is always 0.  So there is no need to adjust the argc or argv.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/arc/dl-machine.h

index 4ac384855713c121a28f268433aacd5d6534d82e..c6ad232384177349e2d847d93a0a1c2e1aba6ac3 100644 (file)
@@ -161,29 +161,16 @@ __start:                                                          \n\
        bl.d    _dl_start                                               \n\
        mov_s   r0, sp  /* pass ptr to aux vector tbl.    */            \n\
        mov r13, r0     /* safekeep app elf entry point.  */            \n\
-                                                                       \n\
-       /* (2). If ldso ran with executable as arg.       */            \n\
-       /*      skip the extra args calc by dl_start.     */            \n\
        ld_s    r1, [sp]       /* orig argc.  */                        \n\
-       ld      r12, [pcl, _dl_skip_args@pcl]                           \n\
-       breq    r12, 0, 1f                                              \n\
                                                                        \n\
-       add2    sp, sp, r12 /* discard argv entries from stack.  */     \n\
-       sub_s   r1, r1, r12 /* adjusted argc on stack.  */              \n\
-       st_s    r1, [sp]                                                \n\
-       add     r2, sp, 4                                               \n\
-       /* intermediate LD for ST emcoding limitations.  */             \n\
-       ld      r3, [pcl, _dl_argv@gotpc]                               \n\
-       st      r2, [r3]                                                \n\
-1:                                                                     \n\
-       /* (3). call preinit stuff.  */                                 \n\
+       /* (2). call preinit stuff.  */                                 \n\
        ld      r0, [pcl, _rtld_local@pcl]                              \n\
        add     r2, sp, 4       ; argv                                  \n\
        add2    r3, r2, r1                                              \n\
        add     r3, r3, 4       ; env                                   \n\
        bl      _dl_init@plt                                            \n\
                                                                        \n\
-       /* (4) call app elf entry point.  */                            \n\
+       /* (3) call app elf entry point.  */                            \n\
        add     r0, pcl, _dl_fini@pcl                                   \n\
        j       [r13]                                                   \n\
                                                                        \n\