Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2021 01:16:54 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 0ad2e9eac9c3 - stable/12 - loader: Don't reserve space for symbols twice.
Message-ID:  <202110080116.1981GsKl011149@gitrepo.freebsd.org>

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

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

commit 0ad2e9eac9c318d9e2422750646d668a0b8fef07
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-07-12 21:17:05 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-08 01:16:00 +0000

    loader: Don't reserve space for symbols twice.
    
    The current code bumps lastaddr twice for the symbol table
    location. However, the first bump is bogus and results in wasted
    space. Remove it.
    
    PR:                     110995
    
    (cherry picked from commit 297e9f364b5aa243572ee52b1faef9b3542c1c9e)
---
 stand/common/load_elf_obj.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/stand/common/load_elf_obj.c b/stand/common/load_elf_obj.c
index 4bff74764922..7df88678a015 100644
--- a/stand/common/load_elf_obj.c
+++ b/stand/common/load_elf_obj.c
@@ -280,8 +280,6 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off)
 		case SHT_SYMTAB:
 			nsym++;
 			ef->symtabindex = i;
-			shdr[i].sh_addr = (Elf_Addr)lastaddr;
-			lastaddr += shdr[i].sh_size;
 			break;
 		}
 	}



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