Hi,

the elfutils part.

before the fix:
binary:
  [11] .text             PROGBITS        00000000100003e0 0003e0 000410 00  AX  
0   0 16
  [22] .opd              PROGBITS        0000000010010ad8 000ad8 0000b8 00  WA  
0   0  8
  [28] .gnu_debuglink    PROGBITS        0000000000000000 000c2c 00001c 00      
0   0  4
.debug:
  [11] .text             NOBITS          00000000100003e0 000250 000410 00  AX  
0   0 16
  [22] .opd              NOBITS          0000000010010ad8 000250 0000b8 00  WA  
0   0  8
                         ^^^^^^^^
  [30] .debug_info       PROGBITS        0000000000000000 0002b1 0000b1 00      
0   0  1

after the fix:
binary:
  [11] .text             PROGBITS        00000000100003e0 0003e0 000410 00  AX  
0   0 16
  [22] .opd              PROGBITS        0000000010010ad8 000ad8 0000b8 00  WA  
0   0  8
  [28] .gnu_debuglink    PROGBITS        0000000000000000 000c2c 00001c 00      
0   0  4
.debug:
  [11] .text             NOBITS          00000000100003e0 000250 000410 00  AX  
0   0 16
  [22] .opd              PROGBITS        0000000010010ad8 000250 0000b8 00  WA  
0   0  8
                         ^^^^^^^^
  [30] .debug_info       PROGBITS        0000000000000000 000369 0000b1 00      
0   0  1

The patch has been regression tested on x86_64-fedora14-linux-gnu,
ppc64-rhel61-linux-gnu.


Thanks,
Jan


src/
2011-03-23  Jan Kratochvil  <[email protected]>

        * strip.c (handle_elf): Provide `.opd' copy for the .debug file.

--- a/src/strip.c
+++ b/src/strip.c
@@ -883,7 +883,8 @@ handle_elf (int fd, Elf *elf, const char *prefix, const 
char *fname,
          bool discard_section = (shdr_info[cnt].idx > 0
                                  && shdr_info[cnt].debug_data == NULL
                                  && shdr_info[cnt].shdr.sh_type != SHT_NOTE
-                                 && cnt != ehdr->e_shstrndx);
+                                 && cnt != ehdr->e_shstrndx
+                                 && strcmp (shdr_info[cnt].name, ".opd") != 0);
 
          /* Set the section header in the new file.  */
          GElf_Shdr debugshdr = shdr_info[cnt].shdr;
_______________________________________________
elfutils-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/elfutils-devel

Reply via email to