NetBSD-Bugs archive

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

port-i386/38170: Probable incorrect calculation of esym in multiboot.c on i386/amd64 platform



>Number:         38170
>Category:       port-i386
>Synopsis:       Probable incorrect calculation of esym in multiboot.c on 
>i386/amd64 platform
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 05 08:45:01 +0000 2008
>Originator:     Gao Ya'nan
>Release:        NetBSD-4.0 and NetBSD-current
>Organization:
None
>Environment:
None
>Description:
When booting the NetBSD kernel by a Multiboot-compliant boot loader with 
MULTIBOOT_INFO_HAS_ELF_SYMS flag in mi_flags, the kernel will find symaddr and 
strtab and store the end of the last section between them to esym. But the esym 
is calculated as below :

*RELOC(int *, &esym) = (int)(strstart + strsize + KERNBASE);

so the 'esym' is just the end of strtab but not the "lowest 'free' address 
after the tables" when the symtab is copied behind the strtab.
>How-To-Repeat:
I just get is by the source code, so, sorry.
>Fix:
Add two new variables store the start address and the size of the last section, 
and update the esym by these two variables.



Home | Main Index | Thread Index | Old Index