The branch main has been updated by dchagin:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d706d02edb5017ae48384d531d38dde6ea38eba6

commit d706d02edb5017ae48384d531d38dde6ea38eba6
Author:     Dmitry Chagin <[email protected]>
AuthorDate: 2023-05-29 08:18:11 +0000
Commit:     Dmitry Chagin <[email protected]>
CommitDate: 2023-05-29 08:18:11 +0000

    sysentvec: Retire sv_imgact_try as unneeded anymore
    
    The sysentvec sv_imgact_try was used by kern_exec() to allow
    non-native ABI to fixup shell path according to ABI root directory.
    Since the non-native ABI can now specify its root directory directly
    to namei() via pwd_altroot() call this facility is not needed anymore.
    
    Differential Revision:  https://reviews.freebsd.org/D40092
    MFC after:              2 month
---
 sys/amd64/amd64/elf_machdep.c       |  2 --
 sys/arm/arm/elf_machdep.c           |  1 -
 sys/arm64/arm64/elf32_machdep.c     |  1 -
 sys/arm64/arm64/elf_machdep.c       |  1 -
 sys/compat/ia32/ia32_sysvec.c       |  1 -
 sys/i386/i386/elf_machdep.c         |  1 -
 sys/kern/imgact_aout.c              |  2 --
 sys/kern/init_main.c                |  1 -
 sys/kern/kern_exec.c                | 15 ++-------------
 sys/powerpc/powerpc/elf32_machdep.c |  1 -
 sys/powerpc/powerpc/elf64_machdep.c |  2 --
 sys/riscv/riscv/elf_machdep.c       |  1 -
 sys/sys/sysent.h                    |  1 -
 13 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index 340b2bb3b017..b1fd0c033743 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -69,7 +69,6 @@ struct sysentvec elf64_freebsd_sysvec_la48 = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = VM_MAXUSER_ADDRESS_LA48,
@@ -112,7 +111,6 @@ struct sysentvec elf64_freebsd_sysvec_la57 = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = VM_MAXUSER_ADDRESS_LA57,
diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c
index c0175bda02a3..c77fde315e78 100644
--- a/sys/arm/arm/elf_machdep.c
+++ b/sys/arm/arm/elf_machdep.c
@@ -75,7 +75,6 @@ struct sysentvec elf32_freebsd_sysvec = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = VM_MAXUSER_ADDRESS,
diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c
index 4a0366df99c4..7fa636628f64 100644
--- a/sys/arm64/arm64/elf32_machdep.c
+++ b/sys/arm64/arm64/elf32_machdep.c
@@ -94,7 +94,6 @@ static struct sysentvec elf32_freebsd_sysvec = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = elf32_prepare_notes,
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = FREEBSD32_MINUSER,
        .sv_maxuser     = FREEBSD32_MAXUSER,
diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c
index ba55e7a0a597..6a9dc708cf6e 100644
--- a/sys/arm64/arm64/elf_machdep.c
+++ b/sys/arm64/arm64/elf_machdep.c
@@ -73,7 +73,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = VM_MAXUSER_ADDRESS,
diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c
index f5aa07dec265..83911c47438d 100644
--- a/sys/compat/ia32/ia32_sysvec.c
+++ b/sys/compat/ia32/ia32_sysvec.c
@@ -116,7 +116,6 @@ struct sysentvec ia32_freebsd_sysvec = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = elf32_prepare_notes,
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = FREEBSD32_MINUSER,
        .sv_maxuser     = FREEBSD32_MAXUSER,
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index fbbb3bb3dd46..d8b7ab9c586b 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -64,7 +64,6 @@ struct sysentvec elf32_freebsd_sysvec = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = VM_MAXUSER_ADDRESS,
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 275fc4e8f3e1..bda6bfeda4c5 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -82,7 +82,6 @@ struct sysentvec aout_sysvec = {
        .sv_szsigcode   = &szsigcode,
        .sv_name        = "FreeBSD a.out",
        .sv_coredump    = NULL,
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = AOUT32_USRSTACK,
@@ -132,7 +131,6 @@ struct sysentvec aout_sysvec = {
        .sv_szsigcode   = &aout_szsigcode,
        .sv_name        = "FreeBSD a.out",
        .sv_coredump    = NULL,
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = AOUT32_MINUSER,
        .sv_maxuser     = AOUT32_USRSTACK,
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index e4cb501bc57b..77a0f5478eb6 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -424,7 +424,6 @@ struct sysentvec null_sysvec = {
        .sv_szsigcode   = NULL,
        .sv_name        = "null",
        .sv_coredump    = NULL,
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = 0,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = VM_MAXUSER_ADDRESS,
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 6d273dab3af6..14aac3f374d2 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -390,7 +390,6 @@ do_execve(struct thread *td, struct image_args *args, 
struct mac *mac_p,
        uintptr_t stack_base;
        struct image_params image_params, *imgp;
        struct vattr attr;
-       int (*img_first)(struct image_params *);
        struct pargs *oldargs = NULL, *newargs = NULL;
        struct sigacts *oldsigacts = NULL, *newsigacts = NULL;
 #ifdef KTRACE
@@ -644,25 +643,15 @@ interpret:
        }
        /* The new credentials are installed into the process later. */
 
-       /*
-        *      If the current process has a special image activator it
-        *      wants to try first, call it.   For example, emulating shell
-        *      scripts differently.
-        */
-       error = -1;
-       if ((img_first = imgp->proc->p_sysent->sv_imgact_try) != NULL)
-               error = img_first(imgp);
-
        /*
         *      Loop through the list of image activators, calling each one.
         *      An activator returns -1 if there is no match, 0 on success,
         *      and an error otherwise.
         */
+       error = -1;
        for (i = 0; error == -1 && execsw[i]; ++i) {
-               if (execsw[i]->ex_imgact == NULL ||
-                   execsw[i]->ex_imgact == img_first) {
+               if (execsw[i]->ex_imgact == NULL)
                        continue;
-               }
                error = (*execsw[i]->ex_imgact)(imgp);
        }
 
diff --git a/sys/powerpc/powerpc/elf32_machdep.c 
b/sys/powerpc/powerpc/elf32_machdep.c
index af8c3abccb5d..0471a8a849fa 100644
--- a/sys/powerpc/powerpc/elf32_machdep.c
+++ b/sys/powerpc/powerpc/elf32_machdep.c
@@ -102,7 +102,6 @@ struct sysentvec elf32_freebsd_sysvec = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_stackprot   = VM_PROT_ALL,
diff --git a/sys/powerpc/powerpc/elf64_machdep.c 
b/sys/powerpc/powerpc/elf64_machdep.c
index 46de0de0348a..6d3ba24560b0 100644
--- a/sys/powerpc/powerpc/elf64_machdep.c
+++ b/sys/powerpc/powerpc/elf64_machdep.c
@@ -75,7 +75,6 @@ struct sysentvec elf64_freebsd_sysvec_v1 = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = VM_MAXUSER_ADDRESS,
@@ -118,7 +117,6 @@ struct sysentvec elf64_freebsd_sysvec_v2 = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = VM_MAXUSER_ADDRESS,
diff --git a/sys/riscv/riscv/elf_machdep.c b/sys/riscv/riscv/elf_machdep.c
index 3f6df253f16e..e0d37257facd 100644
--- a/sys/riscv/riscv/elf_machdep.c
+++ b/sys/riscv/riscv/elf_machdep.c
@@ -75,7 +75,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
        .sv_elf_core_osabi = ELFOSABI_FREEBSD,
        .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR,
        .sv_elf_core_prepare_notes = __elfN(prepare_notes),
-       .sv_imgact_try  = NULL,
        .sv_minsigstksz = MINSIGSTKSZ,
        .sv_minuser     = VM_MIN_ADDRESS,
        .sv_maxuser     = 0,    /* Filled in during boot. */
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index a77feb5bcbf7..c59fa380aa4c 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -117,7 +117,6 @@ struct sysentvec {
        const char      *sv_elf_core_abi_vendor;
        void            (*sv_elf_core_prepare_notes)(struct thread *,
                            struct note_info_list *, size_t *);
-       int             (*sv_imgact_try)(struct image_params *);
        int             (*sv_copyout_auxargs)(struct image_params *,
                            uintptr_t);
        int             sv_minsigstksz; /* minimum signal stack size */

Reply via email to