Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2022 19:32:16 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b4b67e41443f - stable/13 - Eliminate p_elf_machine from struct proc.
Message-ID:  <202206171932.25HJWGuJ008238@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dchagin:

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

commit b4b67e41443f6a52a61c3f32ca9ae214080335f7
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-06-17 19:30:27 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:30:27 +0000

    Eliminate p_elf_machine from struct proc.
    
    Instead of p_elf_machine use machine member of the Elf_Brandinfo which is now
    cached in the struct proc at p_elf_brandinfo member.
    
    Note to MFC: D30918, KBI
    
    Reviewed by:            kib, markj
    Differential Revision:  https://reviews.freebsd.org/D30926
    MFC after:              2 weeks
    
    (cherry picked from commit 945accf502db0dd44522489857f461e29ef17d30)
---
 sys/kern/imgact_elf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 260454e4b9f6..b57065a28a99 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -1403,7 +1403,6 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
 	imgp->reloc_base = addr;
 	imgp->proc->p_osrel = osrel;
 	imgp->proc->p_fctl0 = fctl0;
-	imgp->proc->p_elf_machine = hdr->e_machine;
 	imgp->proc->p_elf_flags = hdr->e_flags;
 
 ret:
@@ -1876,8 +1875,10 @@ __elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs,
 	Elf_Phdr *phdr;
 	Elf_Shdr *shdr;
 	struct phdr_closure phc;
+	Elf_Brandinfo *bi;
 
 	ehdr = (Elf_Ehdr *)hdr;
+	bi = td->td_proc->p_elf_brandinfo;
 
 	ehdr->e_ident[EI_MAG0] = ELFMAG0;
 	ehdr->e_ident[EI_MAG1] = ELFMAG1;
@@ -1890,7 +1891,7 @@ __elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs,
 	ehdr->e_ident[EI_ABIVERSION] = 0;
 	ehdr->e_ident[EI_PAD] = 0;
 	ehdr->e_type = ET_CORE;
-	ehdr->e_machine = td->td_proc->p_elf_machine;
+	ehdr->e_machine = bi->machine;
 	ehdr->e_version = EV_CURRENT;
 	ehdr->e_entry = 0;
 	ehdr->e_phoff = sizeof(Elf_Ehdr);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206171932.25HJWGuJ008238>