=?UTF-8?B?R3LDqWdvaXJlIFN1dHJl?= <gsu...@netbsd.org> writes: > Assume for instance that the boot-loader left us with: > > +--------------+ +--------+ +--------------+ > | string table | | kernel | | symbol table | > +--------------+ +--------+ +--------------+ > > The new addresses computed by lines 338-359 (here, it's really > lines 344-345) will move the tables so that they end up as: > > +--------+--------------+--------------+ > | kernel | symbol table | string table | > +--------+--------------+--------------+
If this ascii art is correct, memmove should be used instead of memcpy. Also, if initial order is kernel, string table, symbol table and a gap between kernel and string table is smaller than symbol table, copying it may overwrite the string table. Is there any guarantee that the gap is large enough? enami.