NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/59234 CVS commit: src/usr.bin/elf2ecoff



The following reply was made to PR port-pmax/59234; it has been noted by GNATS.

From: "Izumi Tsutsui" <tsutsui%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/59234 CVS commit: src/usr.bin/elf2ecoff
Date: Fri, 12 Sep 2025 19:20:47 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Fri Sep 12 19:20:47 UTC 2025
 
 Modified Files:
 	src/usr.bin/elf2ecoff: elf2ecoff.c
 
 Log Message:
 elf2ecoff: fix PR port-pmax/59234: "buffer overflow detected" problem.
 
 Explicitly calculate a size of the target ECOFF string table before
 copying symbol strings, as suggested by mlelstv@.
 
 Tested "build.sh -U -m pmax release" on ubuntu 24.04.2:
 ---
 % ./nbmips-elf2ecoff netboot.elf netboot
   combining PH 0 type 1 flags 0x7 with data, ndata = 73568, nbss =1392
   skipping PH 1 type 0x70000000 flags 0x4
   skipping PH 2 type 0x70000003 flags 0x4
 wrote 20 byte file header.
 wrote 56 byte a.out header.
 wrote 240 bytes of section headers.
 wrote 4 byte pad.
 writing 73568 bytes...
 writing syms at offset 0x12100
 2605 (0xa2d) bytes ELF string table
 2705 (0xa91) bytes required for ECOFF string table
 2705 (0xa91) bytes used for ECOFF string table
 writing symhdr for 258 entries at offset 0x120a0
 ECOFF symhdr: symhdr 60, strsize a91, symsize 1020
 ---
 
 Should be pulled up to netbsd-9, netbsd-10, and netbsd-11.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.36 -r1.37 src/usr.bin/elf2ecoff/elf2ecoff.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index