Hi,
When compiling a big system composed of about 1000 c files, I get a lot
of errors such as reproduced below. Is there a solution to this problem?
Thanks,
Manu
/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/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o: In
function `__do_global_dtors_aux':
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o(.text+
0x94): relocation truncated to fit: R_PPC_PLTREL24
__deregister_frame_info@@GLIBC_2.0
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o: In
function `frame_dummy':
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o(.text+
0x12c): relocation truncated to fit: R_PPC_PLTREL24
__register_frame_info@@GLIBC_2.0
C1/Cobj1.o: In function `Facss3c':
C1/Cobj1.o(.text+0x1480c): relocation truncated to fit: R_PPC_REL24
__sigsetjmp@@GLIBC_2.0
C2/Cobj2.o: In function `Fan1eqv':
C2/Cobj2.o(.text+0x23b78): relocation truncated to fit: R_PPC_REL24
__sigsetjmp@@GLIBC_2.0
C2/Cobj2.o: In function `Fan3cjq':
C2/Cobj2.o(.text+0x24968): relocation truncated to fit: R_PPC_REL24
__sigsetjmp@@GLIBC_2.0
C2/Cobj2.o: In function `Fan3_hc':
C2/Cobj2.o(.text+0x2519c): relocation truncated to fit: R_PPC_REL24
__sigsetjmp@@GLIBC_2.0
C5/Cobj5.o: In function `Fbbi2tl':
C5/Cobj5.o(.text+0x10638): relocation truncated to fit: R_PPC_REL24
calloc@@GLIBC_2.0
C5/Cobj5.o: In function `Fbbow77':
C5/Cobj5.o(.text+0x1074c): relocation truncated to fit: R_PPC_REL24
calloc@@GLIBC_2.0
C5/Cobj5.o: In function `Fbb883r':
C5/Cobj5.o(.text+0x10920): relocation truncated to fit: R_PPC_REL24
calloc@@GLIBC_2.0
C5/Cobj5.o: In function `Fbcj80c':
C5/Cobj5.o(.text+0x10a74): relocation truncated to fit: R_PPC_REL24
calloc@@GLIBC_2.0
C5/Cobj5.o: In function `Fbcwjs6':
C5/Cobj5.o(.text+0x10bd8): relocation truncated to fit: R_PPC_REL24
calloc@@GLIBC_2.0
.....
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
From: "Emmanuel STAPF" <redacted>
To: <redacted>
Subject: Error when linking
Date: Sat, 20 Oct 2001 00:03:44 -0700
Hi,
When compiling a big system composed of about 1000 c files, I get a lot
of errors such as reproduced below. Is there a solution to this problem?
Thanks,
Manu
/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/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o: In
function `__do_global_dtors_aux':
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o(.text+
0x94): relocation truncated to fit: R_PPC_PLTREL24
__deregister_frame_info@@GLIBC_2.0
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o: In
function `frame_dummy':
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o(.text+
0x12c): relocation truncated to fit: R_PPC_PLTREL24
__register_frame_info@@GLIBC_2.0
C1/Cobj1.o: In function `Facss3c':
C1/Cobj1.o(.text+0x1480c): relocation truncated to fit: R_PPC_REL24
__sigsetjmp@@GLIBC_2.0
Glibc has those rabel.
You can check with nm command
Kaoru
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
I should add that they occur only when I have my 1000 files. A similar
project using those C function but smaller compiles without any problem.
Any idea why and what are the possible solutions?
Manu
-----Original Message-----
From: Kaoru Fukui [mailto:k_fukui@highway.ne.jp]
Sent: Saturday, October 20, 2001 00:25
To: manu@stapf.org
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Error when linking
From: "Emmanuel STAPF" <redacted>
To: <redacted>
Subject: Error when linking
Date: Sat, 20 Oct 2001 00:03:44 -0700
quoted
Hi,
When compiling a big system composed of about 1000 c files,
I get a lot
quoted
of errors such as reproduced below. Is there a solution to
this problem?
quoted
Thanks,
Manu
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x20): relocation truncated to fit:
R_PPC_REL24
quoted
__libc_start_main@@GLIBC_2.0
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegin.o: In
0x12c): relocation truncated to fit: R_PPC_PLTREL24
__register_frame_info@@GLIBC_2.0
C1/Cobj1.o: In function `Facss3c':
C1/Cobj1.o(.text+0x1480c): relocation truncated to fit: R_PPC_REL24
__sigsetjmp@@GLIBC_2.0
Glibc has those rabel.
You can check with nm command
Kaoru
I suspect the problem is that you're trying to call functions that the
linker is putting farther apart than can be referenced in a 24 bit
offset, which is the largest branch offset allowed with that type
of call. Would your final program be bigger than 16M? Any branch with
an offset more than 16M can't fit in a normal ppc branch instruction.
If possible, you should make your program smaller, but if that isn't
feasible, I seem to remember someone mentioning a way to make the
linker do calls with absolute, 32 bit addresses. I just don't remember
how to do it, and the ld manpages aren't the best in the world for
architecture specific stuff. This came up once before on the mailing
list, so you might try to search the archives.
Brad Boyer
flar@allandria.com
Emmanuel STAPF wrote:
I should add that they occur only when I have my 1000 files. A similar
project using those C function but smaller compiles without any problem.
Any idea why and what are the possible solutions?
Manu
Indeed my problem is supposed to be around 50MB in size and as you
guessed I can't make it smaller.
I looked at the mailing list archive but I could not find what I should
use to make `ld' link my object files. So if anyone as the solution do
not hesitate to share it.
Thanks,
Manu
-----Original Message-----
From: Brad Boyer [mailto:flar@pants.nu]
Sent: Saturday, October 20, 2001 11:47 AM
To: manu@stapf.org
Cc: 'Kaoru Fukui'; linuxppc-dev@lists.linuxppc.org
Subject: Re: Error when linking
I suspect the problem is that you're trying to call functions that the
linker is putting farther apart than can be referenced in a 24 bit
offset, which is the largest branch offset allowed with that type
of call. Would your final program be bigger than 16M? Any branch with
an offset more than 16M can't fit in a normal ppc branch instruction.
If possible, you should make your program smaller, but if that isn't
feasible, I seem to remember someone mentioning a way to make the
linker do calls with absolute, 32 bit addresses. I just don't remember
how to do it, and the ld manpages aren't the best in the world for
architecture specific stuff. This came up once before on the mailing
list, so you might try to search the archives.
Brad Boyer
flar@allandria.com
Emmanuel STAPF wrote:
quoted
I should add that they occur only when I have my 1000
files. A similar
quoted
project using those C function but smaller compiles without
any problem.
quoted
Any idea why and what are the possible solutions?
Manu
Indeed my problem is supposed to be around 50MB in size and as you
guessed I can't make it smaller.
I looked at the mailing list archive but I could not find what I should
use to make `ld' link my object files. So if anyone as the solution do
not hesitate to share it.
Thanks,
Manu
I tried to build my objects file as shared library just to see if it
would have worked. But with no success, my app core dumps when I try to
launch it. But in my case doing shared library is not an option since I
would have about 100 shared libraries for my app so it becomes a
nightmare to manage.
Does anyone know if there is a linker workaround or if there is a way to
either fix gcc or ld to make sure they can handle large objects with no
modification of the code. I don't see why on LinuxPPC one would have to
modify code that runs on other Linux et UNIX platforms.
Thanks,
Manu
-----Original Message-----
From: owner-linuxppc-dev@lists.linuxppc.org
[mailto:owner-linuxppc-dev@lists.linuxppc.org] On Behalf Of Brad Boyer
Sent: Saturday, October 20, 2001 21:27
To: manu@stapf.org
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Error when linking
Take a look at this thread in the archives:
http://lists.linuxppc.org/linuxppc-user/199907/msg01059.html
Similar problem (90M executable), and the solution seems to
have been to use shared libraries.
Emmanuel STAPF wrote:
quoted
Indeed my problem is supposed to be around 50MB in size and as you
guessed I can't make it smaller.
I looked at the mailing list archive but I could not find what I
should use to make `ld' link my object files. So if anyone as the
solution do not hesitate to share it.
Thanks,
Manu
-----Original Message-----
From: owner-linuxppc-dev@lists.linuxppc.org
[mailto:owner-linuxppc-dev@lists.linuxppc.org] On Behalf Of
Emmanuel STAPF
Sent: Saturday, October 20, 2001 00:04
To: linuxppc-dev@lists.linuxppc.org
Subject: Error when linking
Hi,
When compiling a big system composed of about 1000 c files, I
get a lot of errors such as reproduced below. Is there a
solution to this problem?
Thanks,
Manu
/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/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegi
n.o: In function `__do_global_dtors_aux':
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegi
n.o(.text+
0x94): relocation truncated to fit: R_PPC_PLTREL24
__deregister_frame_info@@GLIBC_2.0
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegi
n.o: In function `frame_dummy':
/usr/local/lib/gcc-lib/powerpc-unknown-linux-gnu/3.0.1/crtbegi
n.o(.text+
0x12c): relocation truncated to fit: R_PPC_PLTREL24
__register_frame_info@@GLIBC_2.0
C1/Cobj1.o: In function `Facss3c':
C1/Cobj1.o(.text+0x1480c): relocation truncated to fit:
R_PPC_REL24 __sigsetjmp@@GLIBC_2.0
C2/Cobj2.o: In function `Fan1eqv':
C2/Cobj2.o(.text+0x23b78): relocation truncated to fit:
R_PPC_REL24 __sigsetjmp@@GLIBC_2.0
C2/Cobj2.o: In function `Fan3cjq':
C2/Cobj2.o(.text+0x24968): relocation truncated to fit:
R_PPC_REL24 __sigsetjmp@@GLIBC_2.0
C2/Cobj2.o: In function `Fan3_hc':
C2/Cobj2.o(.text+0x2519c): relocation truncated to fit:
R_PPC_REL24 __sigsetjmp@@GLIBC_2.0
C5/Cobj5.o: In function `Fbbi2tl':
C5/Cobj5.o(.text+0x10638): relocation truncated to fit:
R_PPC_REL24 calloc@@GLIBC_2.0
C5/Cobj5.o: In function `Fbbow77':
C5/Cobj5.o(.text+0x1074c): relocation truncated to fit:
R_PPC_REL24 calloc@@GLIBC_2.0
C5/Cobj5.o: In function `Fbb883r':
C5/Cobj5.o(.text+0x10920): relocation truncated to fit:
R_PPC_REL24 calloc@@GLIBC_2.0
C5/Cobj5.o: In function `Fbcj80c':
C5/Cobj5.o(.text+0x10a74): relocation truncated to fit:
R_PPC_REL24 calloc@@GLIBC_2.0
C5/Cobj5.o: In function `Fbcwjs6':
C5/Cobj5.o(.text+0x10bd8): relocation truncated to fit:
R_PPC_REL24 calloc@@GLIBC_2.0 .....
Hi,
I'm getting the following warning: warning: pasting "h" and "(" does not
give a valid preprocessing token
Here is the piece of code that shows the problem:
#define CAT(a,b)a ## b
#define TEST_MACRO(n,c,a) (CAT(n,_done) ? CAT(n,_result) :
CAT(c,a))
extern void* h();
extern void f(void*);
extern void* h_result;
extern char h_done;
void k (void* titi)
{
f((TEST_MACRO(h,h,())));
}
If you save this code in a test.c file and use `gcc -Wall -c test.c'
here is what you get:
test.c:11:12: warning: pasting "h" and "(" does not give a valid
preprocessing token
Any idea what is wrong here? My gcc version is 3.01. It was also
happening on my gcc version 2.96 with a slightly different error
message: warning: pasting would not give a valid preprocessing token. I
tried with an even older version (2.7.2.3) and no warnings.
Regards,
Manu
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
From: Franz Sirl <hidden> Date: 2001-11-06 09:55:04
At 09:55 06.11.2001, Emmanuel STAPF wrote:
Hi,
I'm getting the following warning: warning: pasting "h" and "(" does not
give a valid preprocessing token
Here is the piece of code that shows the problem:
#define CAT(a,b)a ## b
#define TEST_MACRO(n,c,a) (CAT(n,_done) ? CAT(n,_result) :
CAT(c,a))
extern void* h();
extern void f(void*);
extern void* h_result;
extern char h_done;
void k (void* titi)
{
f((TEST_MACRO(h,h,())));
}
If you save this code in a test.c file and use `gcc -Wall -c test.c'
here is what you get:
test.c:11:12: warning: pasting "h" and "(" does not give a valid
preprocessing token
Any idea what is wrong here? My gcc version is 3.01. It was also
happening on my gcc version 2.96 with a slightly different error
message: warning: pasting would not give a valid preprocessing token. I
tried with an even older version (2.7.2.3) and no warnings.
h and ( are separate tokens, no need to paste them. Remember, the C
preprocessor is token based, it's not a text processor.
Franz.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/