modpost: Support objects with more than 64k sections
PATCH 1/1 modpost: Support objects with more than 64k sections
In order to help a bit with future merge of -ffunction-sections work, I am resending a self-contained prerequisiste:
fix for "modpost + more than 64000 sections" situation.
This patch makes modpost able to process object files with more than 64k sections. Needed for huge kernel builds (allyesconfig, for example) with -ffunction-sections.
Rediffed against 2.6.33-rc4-next-20100114, placated checkpatch.pl
Signed-off-by Denys Vlasenko <[email protected]>
[[email protected]: updated for 2.6.29]
Signed-off-by Anders Kaseorg <[email protected]>
scripts/mod/file2alias.c +3 -3
@@ -839,16 +839,16 @@ void handle_moddevtable(struct module *mchar *zeros =NULL ;/* We're looking for a section relative symbol */ -if (!sym->st_shndx || sym->st_shndx >= info->hdr->e_shnum) +if (!sym->st_shndx ||get_secindex (info, sym) >= info->num_sections)return ;/* Handle all-NULL symbols allocated into .bss */ -if (info->sechdrs[sym->st_shndx].sh_type &SHT_NOBITS ) { +if (info->sechdrs[get_secindex (info, sym)].sh_type &SHT_NOBITS ) { zeros =calloc (1 , sym->st_size); symval = zeros; }else { symval = (void *)info->hdr - + info->sechdrs[sym->st_shndx].sh_offset + + info->sechdrs[get_secindex (info, sym)].sh_offset + sym->st_value; }
scripts/mod/modpost.c +68 -26
199 lines not on this page · raw message
scripts/mod/modpost.h +43 -0
51 lines not on this page · raw message