public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++
@ 2011-12-07 19:37 junkmailnotread at yahoo dot com
  2011-12-07 19:43 ` [Bug libstdc++/51456] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: junkmailnotread at yahoo dot com @ 2011-12-07 19:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51456

             Bug #: 51456
           Summary: gcc-4.5.3 ARM misaligned relocation for
                    __gxx_personality_v0 in libstdc++
    Classification: Unclassified
           Product: gcc
           Version: 4.5.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: junkmailnotread@yahoo.com


gcc-4.5.3 cross-compiled for ARM generates a misaligned relocation for
__gxx_personality_v0 in libstdc++.

This was found when running Mozilla Fennec, but also occurs with trivial
programs linked against libstdc++ such as Hello World.

C file hello.c contains:

#include <stdio.h>
int main(void)
{
printf("hello world\n");
return (0);
}

Compiled on an x86_64 host as follows:

% arm-softfloat-linux-gnueabi-gcc -o hello hello.c -lstdc++
% 

Run on an ARM target (iPAQ hx4700) produces the following:

# ./hello
Bus error
# 

Adding ld.so debug produces the following:

# export LD_DEBUG=all
# ./hello
<snip>
       682:     
       682:     relocation processing: /lib/libstdc++.so.6 (lazy)
       682:     symbol=__gxx_personality_v0;  lookup in file=./hello [0]
       682:     symbol=__gxx_personality_v0;  lookup in
file=/lib/libstdc++.so.6 [0]
       682:     binding file /lib/libstdc++.so.6 [0] to /lib/libstdc++.so.6
[0]: normal symbol `__gxx_personality_v0' [CXXABI_1.3]
Bus error
# 

Running objdump on the host shows the misaligned symbol:

% arm-softfloat-linux-gnueabi-objdump -R
/usr/lib/gcc/arm-softfloat-linux-gnueabi/4.5.3/libstdc++.so.6.0.14 | fgrep
__gxx_personality_v0
00107afb R_ARM_ABS32       __gxx_personality_v0
00124848 R_ARM_JUMP_SLOT   __gxx_personality_v0
% 

The version information returned by gcc-4.5.3 is the following:

% arm-softfloat-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/arm-softfloat-linux-gnueabi/gcc-bin/4.5.3/arm-softfloat-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-softfloat-linux-gnueabi/4.5.3/lto-wrapper
Target: arm-softfloat-linux-gnueabi
Configured with:
/var/tmp/portage/cross-arm-softfloat-linux-gnueabi/gcc-4.5.3-r1/work/gcc-4.5.3/configure
--prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/arm-softfloat-linux-gnueabi/gcc-bin/4.5.3
--includedir=/usr/lib/gcc/arm-softfloat-linux-gnueabi/4.5.3/include
--datadir=/usr/share/gcc-data/arm-softfloat-linux-gnueabi/4.5.3
--mandir=/usr/share/gcc-data/arm-softfloat-linux-gnueabi/4.5.3/man
--infodir=/usr/share/gcc-data/arm-softfloat-linux-gnueabi/4.5.3/info
--with-gxx-include-dir=/usr/lib/gcc/arm-softfloat-linux-gnueabi/4.5.3/include/g++-v4
--host=x86_64-pc-linux-gnu --target=arm-softfloat-linux-gnueabi
--build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point
--without-ppl --without-cloog --disable-lto --with-float=soft --disable-nls
--with-system-zlib --disable-werror --enable-secureplt --disable-multilib
--enable-libmudflap --disable-libssp --disable-libgomp
--with-python-dir=/share/gcc-data/arm-softfloat-linux-gnueabi/4.5.3/python
--enable-checking=release --disable-libgcj --enable-languages=c,c++
--with-sysroot=/usr/arm-softfloat-linux-gnueabi --disable-bootstrap
--enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.3-r1 p1.0,
pie-0.4.5'
Thread model: posix
gcc version 4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) 
%


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/51456] gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++
  2011-12-07 19:37 [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++ junkmailnotread at yahoo dot com
@ 2011-12-07 19:43 ` pinskia at gcc dot gnu.org
  2011-12-07 19:44 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-07 19:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51456

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-07 19:43:26 UTC ---
What version of glibc are you using?  glibc should be handling the unaligned
relocation correctly.  Also GCC is correct here in using the unaligned
relocation.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/51456] gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++
  2011-12-07 19:37 [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++ junkmailnotread at yahoo dot com
  2011-12-07 19:43 ` [Bug libstdc++/51456] " pinskia at gcc dot gnu.org
@ 2011-12-07 19:44 ` pinskia at gcc dot gnu.org
  2011-12-07 20:31 ` junkmailnotread at yahoo dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-07 19:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51456

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-07 19:44:09 UTC ---
See http://gcc.gnu.org/ml/gcc-help/2005-07/msg00325.html for a problem against
MIPS for the same unaligned relocation.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/51456] gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++
  2011-12-07 19:37 [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++ junkmailnotread at yahoo dot com
  2011-12-07 19:43 ` [Bug libstdc++/51456] " pinskia at gcc dot gnu.org
  2011-12-07 19:44 ` pinskia at gcc dot gnu.org
@ 2011-12-07 20:31 ` junkmailnotread at yahoo dot com
  2011-12-08 10:43 ` rearnsha at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: junkmailnotread at yahoo dot com @ 2011-12-07 20:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51456

--- Comment #3 from junkmailnotread at yahoo dot com 2011-12-07 20:31:02 UTC ---
I'm using glibc-2.12.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/51456] gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++
  2011-12-07 19:37 [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++ junkmailnotread at yahoo dot com
                   ` (2 preceding siblings ...)
  2011-12-07 20:31 ` junkmailnotread at yahoo dot com
@ 2011-12-08 10:43 ` rearnsha at gcc dot gnu.org
  2011-12-09  1:27 ` junkmailnotread at yahoo dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2011-12-08 10:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51456

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2011-12-08 10:41:09 UTC ---
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf
(in section 4.7.1.3) states that R_ARM_ABS32 should work for a relocation place
with any alignment.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/51456] gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++
  2011-12-07 19:37 [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++ junkmailnotread at yahoo dot com
                   ` (3 preceding siblings ...)
  2011-12-08 10:43 ` rearnsha at gcc dot gnu.org
@ 2011-12-09  1:27 ` junkmailnotread at yahoo dot com
  2011-12-30 18:07 ` slyfox at inbox dot ru
  2011-12-30 18:55 ` slyfox at inbox dot ru
  6 siblings, 0 replies; 8+ messages in thread
From: junkmailnotread at yahoo dot com @ 2011-12-09  1:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51456

--- Comment #5 from junkmailnotread at yahoo dot com 2011-12-08 23:46:37 UTC ---
The problem is also present with glibc-2.13

Thanks for the PDF reference. If R_ARM_ABS32 has no alignment requirement then
this must be a glibc bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/51456] gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++
  2011-12-07 19:37 [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++ junkmailnotread at yahoo dot com
                   ` (4 preceding siblings ...)
  2011-12-09  1:27 ` junkmailnotread at yahoo dot com
@ 2011-12-30 18:07 ` slyfox at inbox dot ru
  2011-12-30 18:55 ` slyfox at inbox dot ru
  6 siblings, 0 replies; 8+ messages in thread
From: slyfox at inbox dot ru @ 2011-12-30 18:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51456

Sergei Trofimovich <slyfox at inbox dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slyfox at inbox dot ru

--- Comment #6 from Sergei Trofimovich <slyfox at inbox dot ru> 2011-12-30 17:59:17 UTC ---
> (in section 4.7.1.3) states that R_ARM_ABS32 should work for a relocation place
> with any alignment.

Currently glibc's relocation setup code does not attempt to handle unaligned
relocations. And I think it makes sense.

Does gcc generate slow unaligned reads from such relocations as well?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/51456] gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++
  2011-12-07 19:37 [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++ junkmailnotread at yahoo dot com
                   ` (5 preceding siblings ...)
  2011-12-30 18:07 ` slyfox at inbox dot ru
@ 2011-12-30 18:55 ` slyfox at inbox dot ru
  6 siblings, 0 replies; 8+ messages in thread
From: slyfox at inbox dot ru @ 2011-12-30 18:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51456

--- Comment #7 from Sergei Trofimovich <slyfox at inbox dot ru> 2011-12-30 18:51:35 UTC ---
Just for reference. Proposed fix in glibc:

http://old.nabble.com/-patch--handle-unaligned-arm-abs-relocs-td32964712.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-12-30 18:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-07 19:37 [Bug libstdc++/51456] New: gcc-4.5.3 ARM misaligned relocation for __gxx_personality_v0 in libstdc++ junkmailnotread at yahoo dot com
2011-12-07 19:43 ` [Bug libstdc++/51456] " pinskia at gcc dot gnu.org
2011-12-07 19:44 ` pinskia at gcc dot gnu.org
2011-12-07 20:31 ` junkmailnotread at yahoo dot com
2011-12-08 10:43 ` rearnsha at gcc dot gnu.org
2011-12-09  1:27 ` junkmailnotread at yahoo dot com
2011-12-30 18:07 ` slyfox at inbox dot ru
2011-12-30 18:55 ` slyfox at inbox dot ru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).