.LTHUNK symbols are surviving

Bug #924726 reported by Ken Werner
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Triaged
Medium
Unassigned
Debian
New
Undecided
Unassigned

Bug Description

When compiling the attached testcase using the Linaro g++ the resulting object file contains:
$ readelf -s test.o|grep THUNK
    11: 00000001 28 FUNC LOCAL DEFAULT 27 .LTHUNK0
    23: 00000001 28 FUNC LOCAL DEFAULT 37 .LTHUNK2
    35: 00000001 28 FUNC LOCAL DEFAULT 47 .LTHUNK4

This may cause later link steps to fail.

Revision history for this message
Ken Werner (kwerner) wrote :
Revision history for this message
Ken Werner (kwerner) wrote :

I encountered the issue when compiling Qt 4.8.0 using -O0. It causes qdbusviewer fail to link:

`.LTHUNK0' referenced in section `.text._ZN14PropertyDialogD1Ev[PropertyDialog::~PropertyDialog()]' of .obj/release-shared-emb-arm/moc_propertydialog.o: defined in discarded section `.text._ZN14PropertyDialogD2Ev[_ZN14PropertyDialogD5Ev]' of .obj/release-shared-emb-arm/moc_propertydialog.o
collect2: ld returned 1 exit status

I noticed that as soon as the main.o (the user of that property dialog) gets built with -O1 (or higher) the link succeeds. I guess that most people who are using the multiple inheritance feature of C++ don't build their sources with -O0 usually. Tha might explain why we didn't see this issue earlier.

However, the .THUNK symbols survive regardless of the optimization level or the mode (arm/thumb). I've checked various GCC versions and the latest binutils (20120131) with the following results:
affected:
 * gcc-linaro-4.6-2012.01
 * Linaro binary toolchain (gcc-linaro-arm-linux-gnueabi-2012.01-20120125_linux)
 * g++-arm-linux-gnueabi 4.6.0-8 shipped with Ubunut 11.10 (Oneiric)
 * ARM CSL 2011.03

not affected:
 * FSF GCC 4.7 trunk (r183767)
 * FSF GCC gcc-4_6-branch (r183768)
 * FSF GCC gcc_4_6_0_release (r183772)

Revision history for this message
Ken Werner (kwerner) wrote :

Tarball containing the preprocessed source, assembler output and object files.

Revision history for this message
Ken Werner (kwerner) wrote :

The gcc-linaro head (revno: 106865) is also affected.

Changed in gcc-linaro:
status: New → Triaged
Revision history for this message
Asa Sandahl (asa-sandahl) wrote :

Thank you for the bug report. I've confirmed this with gcc-linaro-4.6-2012.01 on ARM:

asa-san@ursa4:~/bugs/ken$ /scratch/asa-san/cbuild/slaves/ursa4/gcc-linaro-4.6-20
12.0
gcc-linaro-4.6-2012.01/ gcc-linaro-4.6-2012.02/
asa-san@ursa4:~/bugs/ken$ /scratch/asa-san/cbuild/slaves/ursa4/gcc-linaro-4.6-20
12.01/gcc-binary/bin/g++ -c test.cpp
asa-san@ursa4:~/bugs/ken$ readelf -s test.o|grep THUNK
    13: 00000001 72 FUNC LOCAL DEFAULT 29 .LTHUNK0
    32: 00000001 68 FUNC LOCAL DEFAULT 44 .LTHUNK2
    51: 00000001 68 FUNC LOCAL DEFAULT 59 .LTHUNK4

Ken has investigated for which other toolchains the problems does and does not exist, see previous comments.

I have set the priority to Medium, since there is a work around - the error only happens when compiling at -O0.

Changed in gcc-linaro:
importance: Undecided → Medium
Revision history for this message
Timothy Pearson (kb9vqf) wrote :

This bug is also present upstream in Debian Wheezy on armel (package builds perfectly under i386 and amd64).

Build failure: http://quickbuild.pearsoncomputing.net:58080/2553357/buildlog_ubuntu-wheezy-armel.tdebase-trinity_4%3A14.0.0-0debian3%2Br492%2Bpr21~wheezy_FAILEDTOBUILD.txt.gz

Linking CXX shared library libtdeinit_kicker.so
cd /build/buildd/tdebase-trinity-14.0.0/obj-arm-linux-gnueabi/kicker/kicker && /usr/bin/cmake -E cmake_link_script CMakeFiles/tdeinit_kicker-shared.dir/link.txt --verbose=1
/usr/bin/g++ -fPIC -DSMB_CTX_FLAG_USE_KERBEROS -DSMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS -g -Wall -fvisibility=hidden -fvisibility-inlines-hidden -DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -Wl,--no-undefined -shared -Wl,-soname,libtdeinit_kicker.so -o libtdeinit_kicker.so CMakeFiles/tdeinit_kicker-shared.dir/dummy.cpp.o -Wl,-whole-archive core/libkicker_core.a -Wl,-no-whole-archive buttons/libkicker_buttons.a ui/libkicker_ui.a ../libkicker/libkickermain.so.1.0.0 /opt/trinity/lib/libkabc.so.1.2.0 /opt/trinity/lib/libkutils.so.1.2.0 ../../libkonq/libkonq.so.4.2.0 ../../tdmlib/libdmctl.a -lXau interfaces/libkickoffsearch_interfaces.so.0.0.0 /opt/trinity/lib/libvcard.so.0.0.0 /opt/trinity/lib/libkresources.so.1.2.0 /opt/trinity/lib/libkparts.so.2.1.0 /opt/trinity/lib/libkio.so.4.2.0 /opt/trinity/lib/libtdeui.so.4.2.0 -lfreetype -lfontconfig /opt/trinity/lib/libtdesu.so.4.2.0 -lutil /opt/trinity/lib/libkwalletclient.so.1.0.1 /opt/trinity/lib/libtdecore.so.4.2.0 /opt/trinity/lib/libDCOP.so.4.2.0 /opt/trinity/lib/libtdefx.so.4.2.0 -ltqt -ltqt-mt -lXrender -lX11 -lz -lidn -lXcomposite -lICE -lSM -lr -Wl,-rpath,/build/buildd/tdebase-trinity-14.0.0/obj-arm-linux-gnueabi/kicker/libkicker:/opt/trinity/lib:/build/buildd/tdebase-trinity-14.0.0/obj-arm-linux-gnueabi/libkonq:/build/buildd/tdebase-trinity-14.0.0/obj-arm-linux-gnueabi/kicker/kicker/interfaces:
`.LTHUNK4' referenced in section `.text._ZN16PanelDirDropMenuD1Ev[PanelDirDropMenu::~PanelDirDropMenu()]' of ui/libkicker_ui.a(dirdrop_mnu.cpp.o): defined in discarded section `.text._ZN16PanelDirDropMenuD2Ev[_ZN16PanelDirDropMenuD5Ev]' of ui/libkicker_ui.a(dirdrop_mnu.cpp.o)
`.LTHUNK5' referenced in section `.text._ZN16PanelDirDropMenuD1Ev[PanelDirDropMenu::~PanelDirDropMenu()]' of ui/libkicker_ui.a(dirdrop_mnu.cpp.o): defined in discarded section `.text._ZN16PanelDirDropMenuD2Ev[_ZN16PanelDirDropMenuD5Ev]' of ui/libkicker_ui.a(dirdrop_mnu.cpp.o)
collect2: ld returned 1 exit status

This may need to be reported and fixed upstream before it can be fixed in Ubuntu.

Revision history for this message
Christophe Lyon (christophe-lyon) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.