Linux/PPC 32 bit problem with .data
mendell@ca.ibm.com
mendell@ca.ibm.com
Tue Sep 10 10:31:00 GMT 2002
More information about the Binutils mailing list
Tue Sep 10 10:31:00 GMT 2002
- Previous message (by thread): PATCH: Support for MIPS R5900
- Next message (by thread): Linux/PPC 32 bit problem with .data > 64M?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
If you compile the following with gcc
char realbig[36000032] = {1,2};
int main()
{
printf ("&realbig = %#lx\n", &realbig);
}
You get:
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x20): relocation truncated to fit: R_PPC_REL24
__libc_start_main@@GLIBC_2.0
/usr/lib/crti.o: In function `call_gmon_start':
/usr/lib/crti.o(.text+0x14): relocation truncated to fit: R_PPC_LOCAL24PC
_GLOBAL_OFFSET_TABLE_
/usr/lib/gcc-lib/powerpc-suse-linux/2.95.3/crtbegin.o: In function
`__do_global_dtors_aux':
/usr/lib/gcc-lib/powerpc-suse-linux/2.95.3/crtbegin.o(.text+0x88):
relocation truncated to fit: R_PPC_PLTREL24
__deregister_frame_info@@GLIBC_2.0
/usr/lib/gcc-lib/powerpc-suse-linux/2.95.3/crtbegin.o: In function
`frame_dummy':
/usr/lib/gcc-lib/powerpc-suse-linux/2.95.3/crtbegin.o(.text+0x108):
relocation truncated to fit: R_PPC_PLTREL24
__register_frame_info@@GLIBC_2.0
% ld -v
GNU ld version 2.11.90.0.29 (with BFD 2.11.90.0.29)
The problem is that .plt is placed after .data, and the really big .data (>
2**26) prevents the relocations from fitting. Is there any fix for this?
I understand from looking at the linker script, that the .plt section wants
to go with the bss section, and it is put near the .got section. Is there
any way to take advantage of the latter? Anything else I can do? I tried
moving the .plt section in elf32ppclinux.x to after .rodata1, but got:
/usr/lib/crti.o: In function `call_gmon_start':
/usr/lib/crti.o(.text+0x14): relocation truncated to fit: R_PPC_LOCAL24PC
_GLOBAL_OFFSET_TABLE_
which makes sense, since the GOTis now too far from the .text section.
Does ELF really only support 64M of .data on Linux/PPC?
Mark Mendell
mendell@ca.ibm.com
- Previous message (by thread): PATCH: Support for MIPS R5900
- Next message (by thread): Linux/PPC 32 bit problem with .data > 64M?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list