[Bug 1021774] [NEW] GCC for armhf does not emit proper arm/thumb interworking code

Geoff Blake geoffrey.w.blake at gmail.com
Fri Jul 6 15:11:37 UTC 2012


Public bug reported:

GCC for armhf emits incorrect instructions for calling to functions that
are written and compiled as ARM code from Thumb compiled code.  Objdump
of the executables reveals GCC is calling to the ARM compiled functions
with a normal "bl" instruction when it should be a "blx" instruction.
The symptoms experienced with this compiler bug are mysterious segfaults
and gdb complaining of a corrupted stack when trying to debug.  For
reproducing, compile the code with the following flags:

ARM code:  gcc -O3 -marm -mthumb-interwork
Thumb code: gcc -O3 -mthumb-interwork

Testing with GCC 4.5.2 on an armel install with the same compiler flags
generates correct code, emitting "blx" instructions in the proper
places.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: gcc 4:4.6.3-1ubuntu5
Uname: Linux 3.0.13 armv7l
ApportVersion: 2.0.1-0ubuntu8
Architecture: armhf
Date: Fri Jul  6 14:45:15 2012
ProcEnviron:
 TERM=xterm
 SHELL=/bin/bash
 LANG=C
SourcePackage: gcc-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gcc-defaults (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug armhf precise

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1021774

Title:
  GCC for armhf does not emit proper arm/thumb interworking code

Status in “gcc-defaults” package in Ubuntu:
  New

Bug description:
  GCC for armhf emits incorrect instructions for calling to functions
  that are written and compiled as ARM code from Thumb compiled code.
  Objdump of the executables reveals GCC is calling to the ARM compiled
  functions with a normal "bl" instruction when it should be a "blx"
  instruction.  The symptoms experienced with this compiler bug are
  mysterious segfaults and gdb complaining of a corrupted stack when
  trying to debug.  For reproducing, compile the code with the following
  flags:

  ARM code:  gcc -O3 -marm -mthumb-interwork
  Thumb code: gcc -O3 -mthumb-interwork

  Testing with GCC 4.5.2 on an armel install with the same compiler
  flags generates correct code, emitting "blx" instructions in the
  proper places.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: gcc 4:4.6.3-1ubuntu5
  Uname: Linux 3.0.13 armv7l
  ApportVersion: 2.0.1-0ubuntu8
  Architecture: armhf
  Date: Fri Jul  6 14:45:15 2012
  ProcEnviron:
   TERM=xterm
   SHELL=/bin/bash
   LANG=C
  SourcePackage: gcc-defaults
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1021774/+subscriptions




More information about the foundations-bugs mailing list