linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Error when linking
@ 2001-10-20  7:03 Emmanuel STAPF
  2001-10-20  7:25 ` Kaoru Fukui
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel STAPF @ 2001-10-20  7:03 UTC (permalink / raw)
  To: linuxppc-dev


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/

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

* Re: Error when linking
  2001-10-20  7:03 Error when linking Emmanuel STAPF
@ 2001-10-20  7:25 ` Kaoru Fukui
  2001-10-20 16:27   ` Emmanuel STAPF
  0 siblings, 1 reply; 9+ messages in thread
From: Kaoru Fukui @ 2001-10-20  7:25 UTC (permalink / raw)
  To: manu; +Cc: linuxppc-dev


From: "Emmanuel STAPF" <manu@stapf.org>
To: <linuxppc-dev@lists.linuxppc.org>
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/

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

* RE: Error when linking
  2001-10-20  7:25 ` Kaoru Fukui
@ 2001-10-20 16:27   ` Emmanuel STAPF
  2001-10-20 18:47     ` Brad Boyer
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel STAPF @ 2001-10-20 16:27 UTC (permalink / raw)
  To: 'Kaoru Fukui'; +Cc: linuxppc-dev


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" <manu@stapf.org>
> To: <linuxppc-dev@lists.linuxppc.org>
> 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/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/crtbegin.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
>
> Glibc has those rabel.
> You can check with nm command
>
> Kaoru
>
>
>


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: Error when linking
  2001-10-20 16:27   ` Emmanuel STAPF
@ 2001-10-20 18:47     ` Brad Boyer
  2001-10-20 21:28       ` Emmanuel STAPF
  0 siblings, 1 reply; 9+ messages in thread
From: Brad Boyer @ 2001-10-20 18:47 UTC (permalink / raw)
  To: manu; +Cc: 'Kaoru Fukui', linuxppc-dev


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
>


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* RE: Error when linking
  2001-10-20 18:47     ` Brad Boyer
@ 2001-10-20 21:28       ` Emmanuel STAPF
  2001-10-21  4:26         ` Brad Boyer
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel STAPF @ 2001-10-20 21:28 UTC (permalink / raw)
  To: 'Brad Boyer'; +Cc: 'Kaoru Fukui', linuxppc-dev


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:
> >
> >
> > 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
> >
>
>


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: Error when linking
  2001-10-20 21:28       ` Emmanuel STAPF
@ 2001-10-21  4:26         ` Brad Boyer
  2001-10-25 15:55           ` Emmanuel STAPF
  0 siblings, 1 reply; 9+ messages in thread
From: Brad Boyer @ 2001-10-21  4:26 UTC (permalink / raw)
  To: manu; +Cc: linuxppc-dev


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:
>
>
> 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
>

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* RE: Error when linking
  2001-10-21  4:26         ` Brad Boyer
@ 2001-10-25 15:55           ` Emmanuel STAPF
  2001-11-06  8:55             ` Strange warning during C compilation Emmanuel STAPF
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel STAPF @ 2001-10-25 15:55 UTC (permalink / raw)
  To: 'Brad Boyer'; +Cc: linuxppc-dev


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:
> >
> >
> > 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 .....
>
>
>
>


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Strange warning during C compilation
  2001-10-25 15:55           ` Emmanuel STAPF
@ 2001-11-06  8:55             ` Emmanuel STAPF
  2001-11-06  9:55               ` Franz Sirl
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel STAPF @ 2001-11-06  8:55 UTC (permalink / raw)
  To: linuxppc-dev


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/

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

* Re: Strange warning during C compilation
  2001-11-06  8:55             ` Strange warning during C compilation Emmanuel STAPF
@ 2001-11-06  9:55               ` Franz Sirl
  0 siblings, 0 replies; 9+ messages in thread
From: Franz Sirl @ 2001-11-06  9:55 UTC (permalink / raw)
  To: manu; +Cc: linuxppc-dev


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/

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

end of thread, other threads:[~2001-11-06  9:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-20  7:03 Error when linking Emmanuel STAPF
2001-10-20  7:25 ` Kaoru Fukui
2001-10-20 16:27   ` Emmanuel STAPF
2001-10-20 18:47     ` Brad Boyer
2001-10-20 21:28       ` Emmanuel STAPF
2001-10-21  4:26         ` Brad Boyer
2001-10-25 15:55           ` Emmanuel STAPF
2001-11-06  8:55             ` Strange warning during C compilation Emmanuel STAPF
2001-11-06  9:55               ` Franz Sirl

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 NNTP newsgroup(s).