@@ -622,8 +622,6 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
622
622
struct elf_phdr * eppnt ;
623
623
unsigned long load_addr = 0 ;
624
624
int load_addr_set = 0 ;
625
- unsigned long last_bss = 0 , elf_bss = 0 ;
626
- int bss_prot = 0 ;
627
625
unsigned long error = ~0UL ;
628
626
unsigned long total_size ;
629
627
int i ;
@@ -660,7 +658,7 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
660
658
else if (no_base && interp_elf_ex -> e_type == ET_DYN )
661
659
load_addr = - vaddr ;
662
660
663
- map_addr = elf_map (interpreter , load_addr + vaddr ,
661
+ map_addr = elf_load (interpreter , load_addr + vaddr ,
664
662
eppnt , elf_prot , elf_type , total_size );
665
663
total_size = 0 ;
666
664
error = map_addr ;
@@ -686,51 +684,9 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
686
684
error = - ENOMEM ;
687
685
goto out ;
688
686
}
689
-
690
- /*
691
- * Find the end of the file mapping for this phdr, and
692
- * keep track of the largest address we see for this.
693
- */
694
- k = load_addr + eppnt -> p_vaddr + eppnt -> p_filesz ;
695
- if (k > elf_bss )
696
- elf_bss = k ;
697
-
698
- /*
699
- * Do the same thing for the memory mapping - between
700
- * elf_bss and last_bss is the bss section.
701
- */
702
- k = load_addr + eppnt -> p_vaddr + eppnt -> p_memsz ;
703
- if (k > last_bss ) {
704
- last_bss = k ;
705
- bss_prot = elf_prot ;
706
- }
707
687
}
708
688
}
709
689
710
- /*
711
- * Now fill out the bss section: first pad the last page from
712
- * the file up to the page boundary, and zero it from elf_bss
713
- * up to the end of the page.
714
- */
715
- if (padzero (elf_bss )) {
716
- error = - EFAULT ;
717
- goto out ;
718
- }
719
- /*
720
- * Next, align both the file and mem bss up to the page size,
721
- * since this is where elf_bss was just zeroed up to, and where
722
- * last_bss will end after the vm_brk_flags() below.
723
- */
724
- elf_bss = ELF_PAGEALIGN (elf_bss );
725
- last_bss = ELF_PAGEALIGN (last_bss );
726
- /* Finally, if there is still more bss to allocate, do it. */
727
- if (last_bss > elf_bss ) {
728
- error = vm_brk_flags (elf_bss , last_bss - elf_bss ,
729
- bss_prot & PROT_EXEC ? VM_EXEC : 0 );
730
- if (error )
731
- goto out ;
732
- }
733
-
734
690
error = load_addr ;
735
691
out :
736
692
return error ;
0 commit comments