source: scripts/patch/binutils/2.19.1/10-strip_symbol_table.patch@ 41a5f16

clfs-3.0.0-sysvinit sysvinit
Last change on this file since 41a5f16 was 914669c, checked in by Jim Gifford <clfs@…>, 15 years ago

Updated Binutils Patch. Added Patches to fix Issues with Powerpc

  • Property mode set to 100644
File size: 3.0 KB
  • src/bfd/elf.c

    http://sourceware.org/bugzilla/show_bug.cgi?id=9945
    
    2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>
    
    	PR binutils/9945
    	* elf.c (assign_section_numbers): Generate symbol table if there
    	is any relocation in output.
    	(_bfd_elf_compute_section_file_positions): Likewise.
    
    2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>
    
    	PR binutils/9945
    	* objcopy.c (copy_object): Clear HAS_RELOC when stripping all.
    
    RCS file: /cvs/src/src/bfd/elf.c,v
    retrieving revision 1.477
    retrieving revision 1.478
    diff -u -r1.477 -r1.478
     
    27742774  unsigned int section_number, secn;
    27752775  Elf_Internal_Shdr **i_shdrp;
    27762776  struct bfd_elf_section_data *d;
     2777  bfd_boolean need_symtab;
    27772778
    27782779  section_number = 1;
    27792780
     
    28292830  _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->shstrtab_hdr.sh_name);
    28302831  elf_elfheader (abfd)->e_shstrndx = t->shstrtab_section;
    28312832
    2832   if (bfd_get_symcount (abfd) > 0)
     2833  need_symtab = (bfd_get_symcount (abfd) > 0
     2834                || (link_info == NULL
     2835                    && ((abfd->flags & (EXEC_P | DYNAMIC | HAS_RELOC))
     2836                        == HAS_RELOC)));
     2837  if (need_symtab)
    28332838    {
    28342839      t->symtab_section = section_number++;
    28352840      _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->symtab_hdr.sh_name);
     
    28682873  elf_elfsections (abfd) = i_shdrp;
    28692874
    28702875  i_shdrp[t->shstrtab_section] = &t->shstrtab_hdr;
    2871   if (bfd_get_symcount (abfd) > 0)
     2876  if (need_symtab)
    28722877    {
    28732878      i_shdrp[t->symtab_section] = &t->symtab_hdr;
    28742879      if (elf_numsections (abfd) > (SHN_LORESERVE & 0xFFFF))
     
    32613266  bfd_boolean failed;
    32623267  struct bfd_strtab_hash *strtab = NULL;
    32633268  Elf_Internal_Shdr *shstrtab_hdr;
     3269  bfd_boolean need_symtab;
    32643270
    32653271  if (abfd->output_has_begun)
    32663272    return TRUE;
     
    32853291    return FALSE;
    32863292
    32873293  /* The backend linker builds symbol table information itself.  */
    3288   if (link_info == NULL && bfd_get_symcount (abfd) > 0)
     3294  need_symtab = (link_info == NULL
     3295                 && (bfd_get_symcount (abfd) > 0
     3296                     || ((abfd->flags & (EXEC_P | DYNAMIC | HAS_RELOC))
     3297                         == HAS_RELOC)));
     3298  if (need_symtab)
    32893299    {
    32903300      /* Non-zero if doing a relocatable link.  */
    32913301      int relocatable_p = ! (abfd->flags & (EXEC_P | DYNAMIC));
     
    33163326  if (!assign_file_positions_except_relocs (abfd, link_info))
    33173327    return FALSE;
    33183328
    3319   if (link_info == NULL && bfd_get_symcount (abfd) > 0)
     3329  if (need_symtab)
    33203330    {
    33213331      file_ptr off;
    33223332      Elf_Internal_Shdr *hdr;
  • src/binutils/objcopy.c

    RCS file: /cvs/src/src/binutils/objcopy.c,v
    retrieving revision 1.126
    retrieving revision 1.127
    diff -u -r1.126 -r1.127
     
    13961396      flags &= ~bfd_flags_to_clear;
    13971397      flags &= bfd_applicable_file_flags (obfd);
    13981398
     1399      if (strip_symbols == STRIP_ALL)
     1400        flags &= ~HAS_RELOC;
     1401
    13991402      if (!bfd_set_start_address (obfd, start)
    14001403          || !bfd_set_file_flags (obfd, flags))
    14011404        {
Note: See TracBrowser for help on using the repository browser.