Re: R_PPC_REL24 relocation out of range
David
thanks for your reply
> What version of gcc are you using? Older 2.95 versions are known
> to have issues outputting R_PPC_REL24 relocs in PIC code.
2.95.4 (from -unstable)
> Use 'readelf -r' to determine the various types of relocations in
> a shared object file. In a properly compiled PPC .so file, you
it seems that -fPIC doesn't suppress REL24 type relocations:
$ make
g++ -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -fPIC -DTL_PRINTDEBUG
-I/home/bmidgley/cockpit/build/linuxgcc-ppc/
-I/home/bmidgley/cockpit/packages/ -I/usr/lib/sigc++/include
-I/home/bmidgley/cockpit/packages/messaging/src
-I/home/bmidgley/cockpit/packages/multicast/src -I/usr/lib/perl/5.6.0/CORE
-I/usr/lib/gtkmm/include -I/usr/include -I/usr/include/gtk-1.2
-I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include
-I/usr/lib/sigc++/include -Wall -g -fPIC -c
/home/bmidgley/cockpit/packages/scripting/src/PerlWrapper.cpp -o
PerlWrapper.o
$ readelf -r PerlWrapper.o | head -20
Relocation section '.rela.text' at offset 0x62770 contains 139 entries:
Offset Info Type Symbol's Value Symbol's Name
Addend
00000000 0071a R_PPC_REL32 00000000 .got2
+ 7fe0
00000040 06e12 R_PPC_PLTREL24 00000000 Perl_newXS
+ 0
00000060 0071a R_PPC_REL32 00000000 .got2
+ 7fd0
000000d0 07212 R_PPC_PLTREL24 00000000 __t9allocator1ZPc
+ 0
000000e4 07312 R_PPC_PLTREL24 00000000
__t6vector2ZPcZt9allocato + 0
000000ec 06c12 R_PPC_PLTREL24 00000000 __throw
+ 0
000000fc 07412 R_PPC_PLTREL24 00000000 _._t9allocator1ZPc
+ 0
00000120 07512 R_PPC_PLTREL24 00000000
push_back__t6vector2ZPcZt + 0
00000128 07612 R_PPC_PLTREL24 00000000 getenv
+ 0
00000140 07712 R_PPC_PLTREL24 00000004
__t12basic_string3ZcZt18s + 0
00000160 07812 R_PPC_PLTREL24 00000000
__apl__t12basic_string3Zc + 0
00000170 07912 R_PPC_PLTREL24 00000004
c_str__Ct12basic_string3Z + 0
00000184 07512 R_PPC_PLTREL24 00000000
push_back__t6vector2ZPcZt + 0
000001b0 07712 R_PPC_PLTREL24 00000004
__t12basic_string3ZcZt18s + 0
000001e4 07a12 R_PPC_PLTREL24 00000000
__eq__H3ZcZt18string_char + 0
00000200 07a12 R_PPC_PLTREL24 00000000
__eq__H3ZcZt18string_char + 0
00000240 07512 R_PPC_PLTREL24 00000000
push_back__t6vector2ZPcZt + 0
$ gcc --version
2.95.4
$ dpkg -s gcc-2.95
Package: gcc-2.95
Status: install ok installed
Priority: standard
Section: devel
Installed-Size: 3152
Maintainer: Debian GCC maintainers <debian-gcc@lists.debian.org>
Source: gcc-2.95 (2.95.4.ds4-0.010703)
Version: 1:2.95.4-0.010703
Provides: c-compiler
Depends: gcc (>= 1:2.95.3-2), libc6 (>= 2.2.3-1), cpp-2.95 (>= 1:2.95.4),
cpp-2.95 (<< 1:2.95.5), binutils (>= 2.11.90.0.1-1)
Recommends: libc-dev
Suggests: gcc-2.95-doc (>= 1:2.95.4), task-devel-common
Conflicts: libc5-dev
Description: The GNU C compiler.
NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch
(dated 20010522).
.
This is the GNU C compiler, a fairly portable optimizing compiler which
supports multiple languages. This package includes support for C, C++,
and Objective C.
$ dpkg -s gcc
Package: gcc
Status: install ok installed
Priority: standard
Section: devel
Installed-Size: 52
Maintainer: Debian GCC maintainers <debian-gcc@lists.debian.org>
Source: gcc-defaults (0.11)
Version: 2:2.95.4-4
Provides: c-compiler
Depends: cpp (>= 2:2.95.4-4), gcc-2.95, cpp-2.95
Recommends: libc-dev
Suggests: task-c-dev
Description: The GNU C compiler.
The default GNU C compiler for Debian GNU/Linux systems.
.
This is currently version 2.95.4 for this architecture (powerpc).
--
bcmidgle@sanluis.uccs.edu
Brad Midgley
Reply to: