NetBSD-Bugs archive

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

port-i386/38603: unreasonable calculation of esym in multiboot.c on i386/amd64 platform perhaps



>Number:         38603
>Category:       port-i386
>Synopsis:       unreasonable calculation of esym in multiboot.c on i386/amd64 
>platform perhaps
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 07 09:20:00 +0000 2008
>Originator:     Gao Ya'nan
>Release:        NetBSD-current
>Organization:
>Environment:
None
>Description:
After multiboot.c rev-1.15, the esym calculation is like this:

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

But, perhaps there is still a problem. if the strtab is copied prior to the 
symtab, the esym is above the "lowest 'free' address after the tables" and we 
will waste some momeoy when the result of "end + symsize + strsize" is near the 
page boundary.


>How-To-Repeat:
I just get is by the source code, so, sorry.
>Fix:
Actually, the "lowest 'free' address after the tables" is just the "end + 
symsize + strsize", because we only copy symsize and strsize bytes behind the 
end.

so the esym calculation should be like this:

*RELOC(int *, &esym) = (int)(end + symsize + strsize);



Home | Main Index | Thread Index | Old Index