]> git.ozlabs.org Git - yaboot.git/commitdiff
Remove MAX_HEADERS check
authorAnton Blanchard <anton@samba.org>
Sat, 10 Apr 2010 18:05:21 +0000 (18:05 +0000)
committerTony Breeds <tony@bakeyournoodle.com>
Fri, 16 Jul 2010 05:39:07 +0000 (15:39 +1000)
The comparison against MAX_HEADERS doesn't match the error message and
we are dynamically allocating memory for the program headers, so there
should not be a limit.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
second/yaboot.c

index ac63c462c36d5cd4af3dda15e93714cc8f80e6bb..edb11c19dd02e981000a899467aedf000d3a56d3 100644 (file)
@@ -1013,8 +1013,6 @@ int get_params(struct boot_param_t* params)
 void
 yaboot_text_ui(void)
 {
-#define MAX_HEADERS    32
-
      struct boot_file_t        file;
      int                       result;
      static struct boot_param_t        params;
@@ -1211,11 +1209,6 @@ load_elf32(struct boot_file_t *file, loadinfo_t *loadinfo)
 
      loadinfo->entry = e->e_entry;
 
-     if (e->e_phnum > MAX_HEADERS) {
-         prom_printf ("Can only load kernels with one program header\n");
-         goto bail;
-     }
-
      ph = (Elf32_Phdr *)malloc(sizeof(Elf32_Phdr) * e->e_phnum);
      if (!ph) {
          prom_printf ("Malloc error\n");
@@ -1349,11 +1342,6 @@ load_elf64(struct boot_file_t *file, loadinfo_t *loadinfo)
 
      loadinfo->entry = e->e_entry;
 
-     if (e->e_phnum > MAX_HEADERS) {
-         prom_printf ("Can only load kernels with one program header\n");
-         goto bail;
-     }
-
      ph = (Elf64_Phdr *)malloc(sizeof(Elf64_Phdr) * e->e_phnum);
      if (!ph) {
          prom_printf ("Malloc error\n");