This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

can't strip on IRIX 6.3


binutils 2.9.5.0.21 and the current sourceware CVS tree of binutils,
configured with --target=mips-sgi-irix6.3, fails to strip programs and
object files that contain .MIPS.content.* sections.  For example, the
following program:

void foo() {}

when compiled with `gcc -c -g test.o', produces the following object
file: (actually, it was already stripped with binutils 2.9.1, but this
was just to reduce it; the outcome wasn't affected)

test.o-bz2


The problem is that the `.MIPS.content' prefix is removed from the
section name when it is looked up:

Breakpoint 2, _bfd_mips_elf_final_write_processing (abfd=0x100c4670, 
    linker=269240080) at /home/lsd/oliva/src/binutils/bfd/elf32-mips.c:2264
2264              BFD_ASSERT (name != NULL
(gdb) p name
$2 = 0x100c1e1a ".MIPS.content.debug_frame"
(gdb) list
2259              break;
2260    
2261            case SHT_MIPS_CONTENT:
2262              BFD_ASSERT ((*hdrpp)->bfd_section != NULL);
2263              name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section);
2264              BFD_ASSERT (name != NULL
2265                          && strncmp (name, ".MIPS.content",
2266                                      sizeof ".MIPS.content" - 1) == 0);
2267              sec = bfd_get_section_by_name (abfd,
2268                                             name + sizeof ".MIPS.content" - 1);
(gdb) n
2269              BFD_ASSERT (sec != NULL);
(gdb) p sec
$3 = (struct sec *) 0x0

oliva@donald% objdump -h test.o | grep debug_frame
  3 .MIPS.content.debug_frame 00000009  0000000000000000  0000000000000000  000000c0  2**0

I have seen object files and executables in which both
`.MIPS.content.something' and `.something' exist, so it seems to me
that we shouldn't be stripping these prefixes, but I don't know much
about IRIX sections, so I'll leave this decision for you before
attempting to hack something.

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]