public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* darwin-powerpc compiler/linker problem
@ 2004-03-23 21:28 Laurent GUERBY
  2004-03-23 21:35 ` Andrew Pinski
  2004-03-24  0:46 ` Mike Stump
  0 siblings, 2 replies; 5+ messages in thread
From: Laurent GUERBY @ 2004-03-23 21:28 UTC (permalink / raw)
  To: gcc

Hi, I'm trying to compile a large Ada application with macada.org GCC
3.3-apple based GNAT and with 3.5. In both cases I managed to compile
the software, but at link time I get piles of linker message like
the following:

ld: xxx.o relocation overflow for relocation entry 587 in section
(__TEXT,__text) (displacement too large)

I tried -fno-common, -mminimal-toc, -fPIC (all found via google) and
various other combinations but without success. Small programs
or ACATS have no problem compiling, linking and running (-fno-common
needed with 3.5 though).

Any idea of what to try?

Thank you in advance,

Laurent


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

* Re: darwin-powerpc compiler/linker problem
  2004-03-23 21:28 darwin-powerpc compiler/linker problem Laurent GUERBY
@ 2004-03-23 21:35 ` Andrew Pinski
  2004-03-24  0:46 ` Mike Stump
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Pinski @ 2004-03-23 21:35 UTC (permalink / raw)
  To: Laurent GUERBY; +Cc: gcc, Andrew Pinski


On Mar 23, 2004, at 11:48, Laurent GUERBY wrote:

> Hi, I'm trying to compile a large Ada application with macada.org GCC
> 3.3-apple based GNAT and with 3.5. In both cases I managed to compile
> the software, but at link time I get piles of linker message like
> the following:
>
> ld: xxx.o relocation overflow for relocation entry 587 in section
> (__TEXT,__text) (displacement too large)
>
> I tried -fno-common, -mminimal-toc, -fPIC (all found via google) and
> various other combinations but without success. Small programs
> or ACATS have no problem compiling, linking and running (-fno-common
> needed with 3.5 though).
>
> Any idea of what to try?

Yes this is a known linker bug for Darwin's linker, there is nothing
you can do about it except to complain to Apple or fix the linker
yourself.

Thanks,
Andrew Pinski

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

* Re: darwin-powerpc compiler/linker problem
  2004-03-23 21:28 darwin-powerpc compiler/linker problem Laurent GUERBY
  2004-03-23 21:35 ` Andrew Pinski
@ 2004-03-24  0:46 ` Mike Stump
  2004-03-24  5:20   ` Laurent GUERBY
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Stump @ 2004-03-24  0:46 UTC (permalink / raw)
  To: Laurent GUERBY; +Cc: gcc

On Tuesday, March 23, 2004, at 11:48 AM, Laurent GUERBY wrote:
> Hi, I'm trying to compile a large Ada application with macada.org GCC
> 3.3-apple based GNAT and with 3.5. In both cases I managed to compile
> the software, but at link time I get piles of linker message like
> the following:
>
> ld: xxx.o relocation overflow for relocation entry 587 in section
> (__TEXT,__text) (displacement too large)
>
> I tried -fno-common, -mminimal-toc, -fPIC (all found via google) and
> various other combinations but without success. Small programs
> or ACATS have no problem compiling, linking and running (-fno-common
> needed with 3.5 though).
>
> Any idea of what to try?

Source code mods to avoid large arrays is the usual work around as I 
recall.

[ I hope I'm not confusing with another problem that looks like this 
one... ]

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

* Re: darwin-powerpc compiler/linker problem
  2004-03-24  0:46 ` Mike Stump
@ 2004-03-24  5:20   ` Laurent GUERBY
  2004-03-24  6:05     ` Mike Stump
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent GUERBY @ 2004-03-24  5:20 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc

On Tue, 2004-03-23 at 21:49, Mike Stump wrote:
> > Any idea of what to try?
> 
> Source code mods to avoid large arrays is the usual work around as I 
> recall.

You mean static/global arrays? Otherwise our software is full
of large heap allocated arrays so it's hopeless :). We have
some dynamic sized on the stack too (but not that much
since it doesn't work when stack size is limited).

I don't believe we have large static/global arrays
(our software is routinely used as a thread safe library
by multi threaded programs on various platforms and we do
no locking).

I'll double check, but since we got linker complaints
about neatly all of our object files I doubt I'll
find something in the area (at most one or two source files
could have some constant static arrays).

May be GNAT is generating some things in our back though.

Any idea on how to get more precise information about
what the linker calls an "entry"?

Laurent

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

* Re: darwin-powerpc compiler/linker problem
  2004-03-24  5:20   ` Laurent GUERBY
@ 2004-03-24  6:05     ` Mike Stump
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Stump @ 2004-03-24  6:05 UTC (permalink / raw)
  To: Laurent GUERBY; +Cc: gcc

On Tuesday, March 23, 2004, at 01:00 PM, Laurent GUERBY wrote:
> On Tue, 2004-03-23 at 21:49, Mike Stump wrote:
>>> Any idea of what to try?
>>
>> Source code mods to avoid large arrays is the usual work around as I
>> recall.
>
> You mean static/global arrays?

Yes.

> Any idea on how to get more precise information about
> what the linker calls an "entry"?

otool -r xxx.o and then count down 587 lines (first line is 1 I think), 
and then take that address and find the code in the otool -d xxx.o 
stuff?  You can confirm it, by grabbing the .s for it, editing it down 
to not overflow and then relink I think.

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

end of thread, other threads:[~2004-03-23 22:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-23 21:28 darwin-powerpc compiler/linker problem Laurent GUERBY
2004-03-23 21:35 ` Andrew Pinski
2004-03-24  0:46 ` Mike Stump
2004-03-24  5:20   ` Laurent GUERBY
2004-03-24  6:05     ` Mike Stump

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