Skip to content

Commit

Permalink
[kernel] Fix incorrect BSS clearing when BSS size is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Nov 30, 2024
1 parent 2ee8f0a commit 8ed840f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion elks/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ static int execve_aout(struct inode *inode, struct file *filp, char *sptr, size_
/* From this point, exec() will surely succeed */

/* clear bss */
fmemsetb((char *)(size_t)mh.dseg + base_data, seg_data->base, 0, (size_t)mh.bseg);
if ((size_t)mh.bseg)
fmemsetb((char *)(size_t)mh.dseg + base_data, seg_data->base, 0, (size_t)mh.bseg);

/* set data/stack limits and copy argc/argv */
currentp->t_enddata = (size_t)mh.dseg + (size_t)mh.bseg + base_data;
Expand Down
3 changes: 1 addition & 2 deletions elks/tools/objtools/objdump86.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,7 @@ static char * byteord[] = { "LITTLE_ENDIAN", "(2143)","(3412)","BIG_ENDIAN" };
if( h_flgs & 0x80 ) printf(" A_TOVLY");
printf("\n");

if( header[5] )
printf("a_entry = 0x%08lx\n", header[5]);
printf("a_entry = 0x%08lx\n", header[5]);
printf("a_total = 0x%08lx\n", header[6]);
if( header[7] )
printf("a_syms = 0x%08lx\n", header[7]);
Expand Down

0 comments on commit 8ed840f

Please sign in to comment.