This is the mail archive of the 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]

xgcc: Internal error: Segmentation fault (program as)

as from binutils crashes while compiling libstdc++ from
the gcc CVS trunk.

-B/home/zack/src/b/gcc_vanilla/gcc/ -nostdinc++
-B/work/inst/i686-pc-linux-gnu/lib/ -isystem
/work/inst/i686-pc-linux-gnu/include -nostdinc++
-I../../../../../gcc_vanilla/libstdc++-v3/include/c_std -I../include
-I../../../../../gcc_vanilla/libstdc++-v3/libsupc++ -I../libio
-I../../../../../gcc_vanilla/libstdc++-v3/libmath -g -O2
-fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -Wall
-Wno-format -W -Wwrite-strings -Winline
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections
-g -c ../../../../../gcc_vanilla/libstdc++-v3/src/ -fPIC
-DPIC -o .libs/locale.o
xgcc: Internal error: Segmentation fault (program as)
Please submit a full bug report.
See <URL:> for instructions.

(gdb) r -V -Qy -o locale.o locale.s
Starting program: as-new -V -Qy -o locale.o locale.s
GNU assembler version (i386-linux) using BFD version

Program received signal SIGSEGV, Segmentation fault.
0x805f770 in relax_frag (segment=0x8166b10, fragP=0x8170b2c, stretch=18)
    at write.c:2062
2062          target += S_GET_VALUE (symbolP) + sym_frag->fr_address;
(gdb) bt
#0  0x805f770 in relax_frag (segment=0x8166b10, fragP=0x8170b2c, stretch=18)
    at write.c:2062
#1  0x805fd04 in relax_segment (segment_frag_root=0x81704f0, segment=0x8166b10)
    at write.c:2436
#2  0x805e68c in relax_and_size_seg (abfd=0x80c9a20, sec=0x8166b10, xxx=0x0)
    at write.c:615
#3  0x806c6cf in bfd_map_over_sections (abfd=0x80c9a20, 
    operation=0x805e648 <relax_and_size_seg>, user_storage=0x0)
    at bfd/section.c:947
#4  0x805f25b in write_object_file () at write.c:1518
#5  0x804b8b6 in main (argc=2, argv=0x80c9bd8) at as.c:909

(gdb) p symbolP
$1 = (symbolS *) 0x8172f60
(gdb) p sym_frag
$2 = (fragS *) 0x0
(gdb) p *$1
$3 = {bsym = 0x0, sy_value = {X_add_symbol = 0x8167430, 
    X_op_symbol = 0x8173878, X_add_number = 0, X_op = O_illegal, 
    X_unsigned = 0, X_md = 0}, sy_next = 0x45424c2e, sy_previous = 0x3234, 
  sy_frag = 0x0, written = 0, sy_resolved = 0, sy_resolving = 0, 
  sy_used_in_reloc = 0, sy_used = 1, sy_mri_common = 1, sy_obj = {
    local = 135739540, size = 0x8171484, versioned_name = 0x0}, local = 0}
(gdb) call print_symbol_value ($1)
sym 8173880 .L363 resolved local .text._ZNKSt6localeeqERKS_ 0

I don't know what symbol structures are supposed to look like, but
this code pretty obviously assumes that sym_frag is never null.  I
would _guess_ that it should point to zero_address_frag instead.

  if (symbolP)
      fragS *sym_frag;

      sym_frag = symbol_get_frag (symbolP);
      know (!(S_GET_SEGMENT (symbolP) == absolute_section)
	    || sym_frag == &zero_address_frag);
      target += S_GET_VALUE (symbolP) + sym_frag->fr_address;

[I elided a false #if block in there.]

This is Debian's package of H.J's, configured for
i686-pc-linux-gnu.  The Debian patches *appear* to modify only mips
and m68k-specific code.  I do not know what H.J. has done to the
code.  It is supposedly based on binutils CVS mainline; the last entry
in gas/ChangeLog is

2001-03-07  Alan Modra  <>

        * config/tc-i386.c (struct _i386_insn): Rename disp_reloc to reloc.
        (md_assemble [smallest displacement]): Use correct field of i.op[]
        (md_assemble [JumpInterSegment output]): Use correct i.disp_reloc[].
        (md_assemble [immediate output]): Likewise.


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