Menu

#486 strip: incorrect SHT_GROUP handling

RELEASE_1_0
closed
Kai Wang
None
2015-05-27
2015-03-27
Ed Maste
No

Found during FreeBSD exp run while building libjpeg-turbo
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198611

g++   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o cc1 c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-array-notation.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-cilkplus.o c-family/array-notation-common.o c-family/cilk.o c-family/c-ubsan.o arm-c.o glibc-c.o \
  cc1-checksum.o libbackend.a main.o  libcommon-target.a libcommon.a insn-modes.o ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -lmpc -lmpfr -lgmp -rdynamic  -lz
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): no group info for section .data.DW.ref._ZTIN10__cxxabiv115__forced_unwindE
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): no group info for section .data.DW.ref._ZTIN10__cxxabiv115__forced_unwindE
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): no group info for section .data.DW.ref._ZTIN10__cxxabiv115__forced_unwindE
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): no group info for section .data.DW.ref._ZTISt9bad_alloc
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): no group info for section .data.DW.ref._ZTISt9bad_alloc
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): no group info for section .data.DW.ref._ZTISt9bad_alloc
/usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

This is building the gnatdroid-armv7 port, but presumably due to a broken libstdc++.a from the gcc 4.9.2 port.

2 Attachments

Discussion

  • Ed Maste

    Ed Maste - 2015-03-27

    compatibility.o and new_opv.o are extracted from libstdc++-unstripped.a

     
  • Ed Maste

    Ed Maste - 2015-03-27
     
  • Kai Wang

    Kai Wang - 2015-04-11
    • status: new --> closed
    • assigned_to: Kai Wang
     
  • Kai Wang

    Kai Wang - 2015-04-11

    Should be fixed by [r3184].
    --strip-debug should now work correctly with SHT_GROUP sections.

     

    Related

    Commit: [r3184]

  • Ed Maste

    Ed Maste - 2015-05-06

    It looks like the issue still exists at r3815 -- see the most recent updates in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198611

    I will try to obtain more detail.

     
  • Kai Wang

    Kai Wang - 2015-05-17
    • status: closed --> reopened
    • Milestone: 2.0 --> RELEASE_1_0
     
  • Kai Wang

    Kai Wang - 2015-05-17

    Ed, I finally realized I forgot to update the content of SHT_GROUP sections.
    Of course the ld(1) won't work if the indices in the SHT_GROUP sections are pointing
    to wrong sections... Sorry about being sloppy.

    Please, if possible, make a new exp run for [r3207].

    Ticket reopened.

     

    Related

    Commit: [r3207]

  • Ed Maste

    Ed Maste - 2015-05-20

    Latest exp-run shows there's still an issue; when building other software that uses the library the cross-gcc crashes:

    http://package23.nyi.freebsd.org/data/headi386PR198611-default/2015-05-20_07h02m11s/logs/errors/gnatdroid-armv7-20141023.log

    cp xgcc gcc-cross
    g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Ic-family -I/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/gcc-4.9.2/gcc -I/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/gcc-4.9.2/gcc/c-family -I/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/gcc-4.9.2/gcc/../include -I/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/gcc-4.9.2/gcc/../libcpp/include -I/usr/local/include -I/usr/local/include -I/usr/local/include  -I/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/gcc-4.9.2/gcc/../libdecnumber -I/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/gcc-4.9.2/gcc/../libdecnumber/dpd -I../libdecnumber -I/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/gcc-4.9.2/gcc/../libbacktrace    -o c-family/cppspec.o -MT c-family/cppspec.o -MMD -MP -MF c-family/.deps/cppspec.TPo /wrkdirs/usr/ports/lang/gnatdroid-armv7/work/gcc-4.9.2/gcc/c-family/cppspec.c
    g++   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o cpp gcc.o ggc-none.o \
      c-family/cppspec.o  libcommon-target.a \
       libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
    /wrkdirs/usr/ports/lang/gnatdroid-armv7/work/build/./gcc/xgcc -B/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/build/./gcc/ -dumpspecs > tmp-specs
    Makefile:1824: recipe for target 'specs' failed
    gmake[3]: *** [specs] Segmentation fault (core dumped)
    gmake[3]: Leaving directory '/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/build/gcc'
    Makefile:3971: recipe for target 'all-gcc' failed
    gmake[2]: *** [all-gcc] Error 2
    gmake[2]: Leaving directory '/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/build'
    Makefile:860: recipe for target 'all' failed
    gmake[1]: *** [all] Error 2
    gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/gnatdroid-armv7/work/build'
    *** Error code 1
    
     

    Last edit: Ed Maste 2015-05-20
  • Ed Maste

    Ed Maste - 2015-05-20

    I've opened a PR to track this issue in FreeBSD also - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200350

    The failure is now rather different.

     
  • Ed Maste

    Ed Maste - 2015-05-20

    See Ticket #494 and Ticket #495 for further SHT_GROUP failures. It may be that the issue originally encountered here is fixed by r3207 and the new failure is due to issues reported in those tickets.

     
  • Kai Wang

    Kai Wang - 2015-05-25

    Ed, thanks for all the testing.
    SHT_GROUP failures should be fixed now.

    The gcc crash issue in this ticket should be fixed by [r3216].
    From my own testing gnatdroid-armv7 is now building fine.
    Although I guess a new exp-run is still needed.

     

    Related

    Commit: [r3216]

  • Ed Maste

    Ed Maste - 2015-05-25

    The exp-run PR (http://bugs.freebsd.org/198611) now has a patch to update FreeBSD to [r3222].

     

    Related

    Commit: [r3222]

  • Ed Maste

    Ed Maste - 2015-05-27
    • status: reopened --> closed
     
  • Ed Maste

    Ed Maste - 2015-05-27

    Confirmed fixed with exp-run at r3223

     

Log in to post a comment.