unresolvable R_ARM_THM_CALL relocation

Bug #641126 reported by Loïc Minier
56
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Chromium
Unknown
Unknown
Linaro Binutils
Fix Released
Medium
Unassigned
binutils
Fix Released
Medium
binutils (Ubuntu)
Fix Released
High
Unassigned
Oneiric
Fix Released
High
Unassigned
chromium-browser (Ubuntu)
Fix Released
Undecided
Unassigned
Oneiric
Fix Released
Undecided
Unassigned
insighttoolkit (Debian)
Fix Released
Unknown
insighttoolkit (Ubuntu)
Fix Released
High
Unassigned
Oneiric
Fix Released
High
Unassigned

Bug Description

Hi there

I just saw that chromium-browser wasn't built with -fPIE on armel due to this bug:
http://code.google.com/p/chromium/issues/detail?id=55439

http://launchpadlibrarian.net/55522699/buildlog_ubuntu-maverick-armel.chromium-browser_6.0.472.55~r58392-0ubuntu1_FAILEDTOBUILD.txt.gz

  LINK(target) out/Release/chrome
/usr/bin/ld.bfd.real: out/Release/obj.target/skia/libskia.a(SkBlurDrawLooper.o)(.text._ZN16SkBlurDrawLooper10CreateProcER23SkFlattenableReadBuffer[SkBlurDrawLooper::CreateProc(SkFlattenableReadBuffer&)]+0x6): unresolvable R_ARM_THM_CALL relocation against symbol `operator new(unsigned int)@@GLIBCXX_3.4'
/usr/bin/ld.bfd.real: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

I think we should look into it, -fPIE is needed for some security features and web browsers are a critical piece of software that we want to protect.

Cheers,

Revision history for this message
Fabien Tassin (fta) wrote :

same in Natty. i have to disable PIE for arm, as i did for Maverick.

http://launchpadlibrarian.net/60055713/buildlog_ubuntu-natty-armel.chromium-browser_8.0.552.215~r67652-0ubuntu1_FAILEDTOBUILD.txt.gz

  LINK(target) out/Release/chrome
/usr/bin/ld.bfd.real: out/Release/obj.target/third_party/WebKit/WebCore/WebCore.gyp/libwebcore_bindings.a(XPathGrammar.o)(.text._ZN3WTF6VectorIPN7WebCore5XPath9PredicateELj0EE15reserveCapacityEj[WTF::Vector<WebCore::XPath::Predicate*, 0u>::reserveCapacity(unsigned int)]+0x3e): unresolvable R_ARM_THM_CALL relocation against symbol `memcpy@@GLIBC_2.4'
/usr/bin/ld.bfd.real: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

Michael Hope (michaelh1)
Changed in binutils-linaro:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

happens also with chromium-browser-12.0.742.91~r87961 from oneiric on armel

tags: added: arm-porting-queue ftbfs
Revision history for this message
In , Marcin Juszkiewicz (hrw) wrote :

Some time ago I saw a bug reported in Ubuntu that Chromium browser does not build on armel architecture. I took a look at it, tried few versions and got to point where I lack ideas what can be wrong.

https://bugs.launchpad.net/binutils-linaro/+bug/641126 is original bug with few duplicates providing extra information.

Linking fails:

chromium-browser 14.0.807.0~svn20110630r91077:
/usr/bin/ld.bfd.real: out/Release/obj.target/webkit/support/../../glue/webkit/plugins/ppapi/ppb_opengles_impl.o(.text._ZN6webkit5ppapi
12_GLOBAL__N_115VertexAttrib4fvEijPKf+0x44): unresolvable R_ARM_THM_JUMP24 relocation against symbol `memcpy@@GLIBC_2.4'
/usr/bin/ld.bfd.real: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [out/Release/chrome] Error 1

chromium-browser 12.0.742.91~r87961:
/usr/bin/ld.bfd.real: out/Release/obj.target/third_party/cacheinvalidation/../../cacheinvalidation_proto_cpp/gen/protoc_out/google/cacheinvalidation/internal.pb.o(.text._ZN12invalidation21ClientToServerMessage27MergePartialFromCodedStreamEPN6google8protobuf2io16CodedInputStreamE+0x7d2): unresolvable R_ARM_THM_CALL relocation against symbol `operator new(unsigned int)@@GLIBCXX_3.4'
/usr/bin/ld.bfd.real: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [out/Release/chrome] Error 1

I got both R_ARM_THM_CALL and R_ARM_THM_JUMP24 using binutils 2.21.5x snapshots. Linking of 14.x version took ~9h and 3GB of memory (920MB physical, rest was swap on slow usb hdd). 12.x one took much less time - 7h for whole build (do not remember linking time)

Changed in binutils:
importance: Unknown → Medium
status: Unknown → Confirmed
Matthias Klose (doko)
Changed in insighttoolkit (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :
Revision history for this message
Matthias Klose (doko) wrote :

attached link command. the link works with ld.gold, fails with ld.bfd

Changed in binutils (Ubuntu Oneiric):
importance: Undecided → High
status: New → Confirmed
Changed in chromium-browser (Ubuntu):
status: New → Confirmed
Matthias Klose (doko)
tags: added: oneiric
Revision history for this message
Richard Sandiford (rsandifo) wrote :

Thanks Matthias for the self-contained testcase, it was a massive help.

The problem appears to be caused by out-of-range Thumb-2 branches to
a PLT entry. The linker correct redirects the branch to a stub, but it doesn't
then record that the relocation has been resolved (i.e. doesn't need a
dynamic counterpart).

The patch that I'm about to attach fixes the bogus error, but it looks like
the error would trigger whenever these stubs are used with PLTs. I'm therefore
a bit worried that the PLT/stub combination seen in these two packages
might not have had much execution testing.

Revision history for this message
Richard Sandiford (rsandifo) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package insighttoolkit - 3.20.0-13ubuntu1

---------------
insighttoolkit (3.20.0-13ubuntu1) oneiric; urgency=low

  * Set CMAKE_BUILD_TYPE to RelWithDebInfo for non ix86 targets to build
    with -O2, not -O3.
  * Build using binutils-gold on ARM, work-around LP: #641126.
  * Install into dist-packages, not site-packages.
  * Build using dh_python2.
 -- Matthias Klose <email address hidden> Wed, 07 Sep 2011 14:32:21 +2000

Changed in insighttoolkit (Ubuntu Oneiric):
status: Confirmed → Fix Released
Changed in insighttoolkit (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package binutils - 2.21.53.20110810-0ubuntu2

---------------
binutils (2.21.53.20110810-0ubuntu2) oneiric; urgency=low

  * Build with proposed patch for PR ld/12965. LP: #641126.
  * Don't ship .la files in the cross binutils packages. LP: #760420.
  * For native builds, add the multiarch directories to the default
    search path. LP: #780455.
 -- Matthias Klose <email address hidden> Wed, 07 Sep 2011 15:36:22 +0200

Changed in binutils (Ubuntu Oneiric):
status: Confirmed → Fix Released
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Proposed fix" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package chromium-browser - 13.0.782.215~r97094-0ubuntu2

---------------
chromium-browser (13.0.782.215~r97094-0ubuntu2) oneiric; urgency=low

  * Enable hardening on armel. LP: #641126.
 -- Matthias Klose <email address hidden> Wed, 21 Sep 2011 23:47:00 +0200

Changed in chromium-browser (Ubuntu Oneiric):
status: Confirmed → Fix Released
Changed in insighttoolkit (Debian):
status: New → Fix Released
Revision history for this message
In , Will Newton (will-newton) wrote :

A fix for this bug was applied in 2011 and the corresponding launchpad bug has been closed:

2011-10-13 Richard Sandiford <email address hidden>

       * elf32-arm.c (elf32_arm_final_link_relocate): Mark PLT calls via
       stubs as resolved.

git commit 589342bc49be60680807fa478fc220591fb06942

Resolving as fixed.

Changed in binutils-linaro:
status: Confirmed → Fix Released
Changed in binutils:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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