source:
scripts/patch/binutils/2.19.1/10-strip_symbol_table.patch@
ec008670
Last change on this file since ec008670 was 914669c, checked in by , 15 years ago | |
---|---|
|
|
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
2774 2774 unsigned int section_number, secn; 2775 2775 Elf_Internal_Shdr **i_shdrp; 2776 2776 struct bfd_elf_section_data *d; 2777 bfd_boolean need_symtab; 2777 2778 2778 2779 section_number = 1; 2779 2780 … … 2829 2830 _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->shstrtab_hdr.sh_name); 2830 2831 elf_elfheader (abfd)->e_shstrndx = t->shstrtab_section; 2831 2832 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) 2833 2838 { 2834 2839 t->symtab_section = section_number++; 2835 2840 _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->symtab_hdr.sh_name); … … 2868 2873 elf_elfsections (abfd) = i_shdrp; 2869 2874 2870 2875 i_shdrp[t->shstrtab_section] = &t->shstrtab_hdr; 2871 if ( bfd_get_symcount (abfd) > 0)2876 if (need_symtab) 2872 2877 { 2873 2878 i_shdrp[t->symtab_section] = &t->symtab_hdr; 2874 2879 if (elf_numsections (abfd) > (SHN_LORESERVE & 0xFFFF)) … … 3261 3266 bfd_boolean failed; 3262 3267 struct bfd_strtab_hash *strtab = NULL; 3263 3268 Elf_Internal_Shdr *shstrtab_hdr; 3269 bfd_boolean need_symtab; 3264 3270 3265 3271 if (abfd->output_has_begun) 3266 3272 return TRUE; … … 3285 3291 return FALSE; 3286 3292 3287 3293 /* 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) 3289 3299 { 3290 3300 /* Non-zero if doing a relocatable link. */ 3291 3301 int relocatable_p = ! (abfd->flags & (EXEC_P | DYNAMIC)); … … 3316 3326 if (!assign_file_positions_except_relocs (abfd, link_info)) 3317 3327 return FALSE; 3318 3328 3319 if ( link_info == NULL && bfd_get_symcount (abfd) > 0)3329 if (need_symtab) 3320 3330 { 3321 3331 file_ptr off; 3322 3332 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
1396 1396 flags &= ~bfd_flags_to_clear; 1397 1397 flags &= bfd_applicable_file_flags (obfd); 1398 1398 1399 if (strip_symbols == STRIP_ALL) 1400 flags &= ~HAS_RELOC; 1401 1399 1402 if (!bfd_set_start_address (obfd, start) 1400 1403 || !bfd_set_file_flags (obfd, flags)) 1401 1404 {
Note:
See TracBrowser
for help on using the repository browser.