sbtools: fix sbtoelf to handle files with more than one hundred commands

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30810 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Amaury Pouly 2011-10-20 10:14:50 +00:00
parent b458d33190
commit f4a1501d4a

View file

@ -272,10 +272,10 @@ void elf_write_file(struct elf_params_t *params, elf_write_fn_t write, void *use
/* allocate enough size to hold any combinaison of .text/.bss in the string table:
* - one empty name ("\0")
* - at most N names of the form ".textXX\0" or ".bssXX\0"
* - at most N names of the form ".textXXXX\0" or ".bssXXXX\0"
* - one name ".shstrtab\0" */
char *strtbl_content = malloc(1 + strlen(".shstrtab") + 1 +
phnum * (strlen(".textXX") + 1));
phnum * (strlen(".textXXXX") + 1));
strtbl_content[0] = '\0';
strcpy(&strtbl_content[1], ".shstrtab");