Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Alpha linker problems
@ 2000-03-26 17:41 Stephen Williams
  2000-03-26 20:01 ` Greg Lindahl
  2000-03-27  2:40 ` Richard Henderson
  0 siblings, 2 replies; 12+ messages in thread
From: Stephen Williams @ 2000-03-26 17:41 UTC (permalink / raw)
  To: axp-list


I'm working on a Verilog compiler that generates C++ code. This generally
works pretty well, but I'm having troubles with some larger Verilog source
files. To wit:

icarus.com % sh go.sh
+ ./ivl -P a.pf -N a.net -fVPI_MODULE_PATH=vpi -sm16x16 -Fcprop -Fnodangle -tvvm -ofoo.cc foo.vl
+ g++ -g -O -rdynamic -fno-exceptions -Ivvm -Ivpi -Lvvm foo.cc -lvvm -ldl
/usr/bin/ld: /tmp/ccIBXz4j.o: .got subsegment exceeds 64K (size 138800)
/usr/bin/ld: failed to set dynamic section sizes: No such file or directory
collect2: ld returned 1 exit status

I'm only having this problem on my alpha. People on Linux/ix86, Solaris
etc. are not having these difficulties. I don't understand what the .got
section is, why it is limited to 64K and why my code so thoroughly over-
flows that section.

This is a real impediment to using my alpha for this sort of thing, so I
need to find a way to get past this. Real hardware simulations are real
big, so I really need to find a way to cope. It has been suggested to me
that reducing symbols helps, and I have done some of that, but the problem
seems to have actually become *worse*.

icarus.com % ld -v
GNU ld version 2.9.1 (with BFD 2.9.1.0.24)
icarus.com % g++ -v
Reading specs from /usr/lib/gcc-lib/alpha-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
icarus.com % as -v
GNU assembler version 2.9.1 (alpha-redhat-linux), using BFD version 2.9.1.0.24


-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."



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

* RE: Alpha linker problems
  2000-03-26 17:41 Alpha linker problems Stephen Williams
@ 2000-03-26 20:01 ` Greg Lindahl
  2000-03-26 21:27   ` Stephen Williams
  2000-03-27  2:40 ` Richard Henderson
  1 sibling, 1 reply; 12+ messages in thread
From: Greg Lindahl @ 2000-03-26 20:01 UTC (permalink / raw)
  To: axp-list

> I'm working on a Verilog compiler that generates C++ code. This generally
> works pretty well, but I'm having troubles with some larger Verilog source
> files.

Search the archives; this has been discussed several times. Not that there's
really an answer, but you'll see lots of useful discussion.

-- g


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

* Re: Alpha linker problems
  2000-03-26 20:01 ` Greg Lindahl
@ 2000-03-26 21:27   ` Stephen Williams
  2000-03-26 21:41     ` Rich Payne
  2000-03-26 22:50     ` Greg Lindahl
  0 siblings, 2 replies; 12+ messages in thread
From: Stephen Williams @ 2000-03-26 21:27 UTC (permalink / raw)
  To: axp-list


glindahl@hpti.com said:
> Search the archives; this has been discussed several times. Not that
> there's really an answer, but you'll see lots of useful discussion. 

The RedHat archives search seems to be broken, and the www.alphalinux.org
archives turn up nothing with ".got" in any subject lines. (It doesn't have
a content search that I can find.) So I'm having no luck searching the
archives.

Either I'm blind, an idiot, or both.

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."



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

* Re: Alpha linker problems
  2000-03-26 21:27   ` Stephen Williams
@ 2000-03-26 21:41     ` Rich Payne
  2000-03-26 22:50     ` Greg Lindahl
  1 sibling, 0 replies; 12+ messages in thread
From: Rich Payne @ 2000-03-26 21:41 UTC (permalink / raw)
  To: axp-list


There's a searchable version at:

http://www.lib.uaa.alaska.edu/axp-list/

--rdp

On Sun, 26 Mar 2000, Stephen Williams wrote:

> 
> glindahl@hpti.com said:
> > Search the archives; this has been discussed several times. Not that
> > there's really an answer, but you'll see lots of useful discussion. 
> 
> The RedHat archives search seems to be broken, and the www.alphalinux.org
> archives turn up nothing with ".got" in any subject lines. (It doesn't have
> a content search that I can find.) So I'm having no luck searching the
> archives.
> 
> Either I'm blind, an idiot, or both.
> 
> -- 
> Steve Williams                "The woods are lovely, dark and deep.
> steve@icarus.com              But I have promises to keep,
> steve@picturel.com            and lines to code before I sleep,
> http://www.picturel.com       And lines to code before I sleep."
> 
> 
> -- 
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com
> 

Rich Payne
rpayne@alphalinux.org			www.alphalinux.org


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

* RE: Alpha linker problems
  2000-03-26 21:27   ` Stephen Williams
  2000-03-26 21:41     ` Rich Payne
@ 2000-03-26 22:50     ` Greg Lindahl
  2000-03-26 23:30       ` tibor
  1 sibling, 1 reply; 12+ messages in thread
From: Greg Lindahl @ 2000-03-26 22:50 UTC (permalink / raw)
  To: axp-list

> Either I'm blind, an idiot, or both.

You're neither, it's that the community has failed to make the archives
visible enough. Um, can the alphalinux.org guys put the archive links on
your pages? You have a local copy but not a searchable archive.


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

* RE: Alpha linker problems
  2000-03-26 22:50     ` Greg Lindahl
@ 2000-03-26 23:30       ` tibor
  2000-03-27  2:27         ` Rich Payne
  0 siblings, 1 reply; 12+ messages in thread
From: tibor @ 2000-03-26 23:30 UTC (permalink / raw)
  To: axp-list

On Sun, 26 Mar 2000, Greg Lindahl wrote:

> > Either I'm blind, an idiot, or both.
> 
> You're neither, it's that the community has failed to make the archives
> visible enough. Um, can the alphalinux.org guys put the archive links on
> your pages? You have a local copy but not a searchable archive.

A link is actually already there under "Other Pages".  Currently the link
reads:

  "Another archive of axp-list from Mike Tibor"

Maybe the word "searchable" could be used in there somewhere, and also a
link added the page at http://www.alphalinux.org/docs/ .

Just tossing out ideas--I'm not involved with alphalinux.org. 

Mike
-- 
Mike Tibor         Univ. of Alaska Anchorage    (907) 786-1001 voice
LAN Technician     Consortium Library             (907) 786-6050 fax
tibor@lib.uaa.alaska.edu       http://www.lib.uaa.alaska.edu/~tibor/
http://www.lib.uaa.alaska.edu/~tibor/pgpkey  for PGP public key


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

* RE: Alpha linker problems
  2000-03-26 23:30       ` tibor
@ 2000-03-27  2:27         ` Rich Payne
  0 siblings, 0 replies; 12+ messages in thread
From: Rich Payne @ 2000-03-27  2:27 UTC (permalink / raw)
  To: axp-list

On Sun, 26 Mar 2000 tibor@lib.uaa.alaska.edu wrote:

> On Sun, 26 Mar 2000, Greg Lindahl wrote:
> 
> > > Either I'm blind, an idiot, or both.
> > 
> > You're neither, it's that the community has failed to make the archives
> > visible enough. Um, can the alphalinux.org guys put the archive links on
> > your pages? You have a local copy but not a searchable archive.
> 
> A link is actually already there under "Other Pages".  Currently the link
> reads:
> 
>   "Another archive of axp-list from Mike Tibor"
> 
> Maybe the word "searchable" could be used in there somewhere, and also a

Done.

> link added the page at http://www.alphalinux.org/docs/ .
>

Didn't put it in Docs, but I did add it to out archives page:
http://www.alphalinux.org/archives

--rdp


Rich Payne
rpayne@alphalinux.org			www.alphalinux.org


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

* Re: Alpha linker problems
  2000-03-26 17:41 Alpha linker problems Stephen Williams
  2000-03-26 20:01 ` Greg Lindahl
@ 2000-03-27  2:40 ` Richard Henderson
  2000-03-27  4:42   ` Greg Lindahl
  1 sibling, 1 reply; 12+ messages in thread
From: Richard Henderson @ 2000-03-27  2:40 UTC (permalink / raw)
  To: axp-list

On Sun, Mar 26, 2000 at 09:41:08AM -0800, Stephen Williams wrote:
> I don't understand what the .got section is, why it is limited to 64K
> and why my code so thoroughly overflows that section.

The .got section stores addresses of symbols.  It consists of a
number of subsections, each limited to 64k, because that's how
much one can address with one memory instruction.  Each object
file may reference only one of these subsections, thus each object
file is limited to 64k.

As to why your code requires so many symbol address loads, one
would have to examine the code to be sure.

Note that there are several techniques that can be applied to
reduce the number of symbol addresses needed by a program.  GCC
does not employ all of these, mostly because GAS lacks the ability
to emit all of the relocations.  Since CCC emits object files
directly, it does not suffer from this restriction.  You may have
better success with that.  Of course, Compaq's C++ compiler isn't
released yet, but I recently heard noises about "soon".

There are also .got reduction strategies that can be done at link
time.  You might try getting the most recent binutils (2.9.5.0.31?)
and using `g++ -Wl,-relax'.


r~


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

* RE: Alpha linker problems
  2000-03-27  2:40 ` Richard Henderson
@ 2000-03-27  4:42   ` Greg Lindahl
  2000-03-27  5:00     ` Stephen Williams
  0 siblings, 1 reply; 12+ messages in thread
From: Greg Lindahl @ 2000-03-27  4:42 UTC (permalink / raw)
  To: axp-list

> The .got section stores addresses of symbols.  It consists of a
> number of subsections, each limited to 64k, because that's how
> much one can address with one memory instruction.  Each object
> file may reference only one of these subsections, thus each object
> file is limited to 64k.

Ergo, one way to work around this is to split your source into more files...

-- g


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

* Re: Alpha linker problems
  2000-03-27  4:42   ` Greg Lindahl
@ 2000-03-27  5:00     ` Stephen Williams
  2000-03-27  5:04       ` Greg Lindahl
  2000-03-27 21:23       ` Richard Henderson
  0 siblings, 2 replies; 12+ messages in thread
From: Stephen Williams @ 2000-03-27  5:00 UTC (permalink / raw)
  To: axp-list


glindahl@hpti.com said:
> Ergo, one way to work around this is to split your source into more
> files... 

Not as easy as it sounds. The C++ code is machine generated from a Verilog
input file. And those input files can get pretty big. I guess it's not clear
to me whether static symbols make a difference or not. If the .got section
only stores addresses of global symbols, then that is something I can work
on. I have a lot of member functions that C++ always makes external. I can
replace them with ordinary, and static, functions if that would help.

rth@twiddle.net said:
> Each object file may reference only one of these subsections, thus
> each object file is limited to 64k.

Does you really mean that the *object file* is limited to 64K, or that the
.got subsection for each object file is limited to 64K. You must mean the
.got subsection is limited.

What things go into the .got subsection? External symbols? If I make some
of the symbols static, will that keep them out of the .got subsection? As
I said, if this is the case, I can arrange for my symbols to be made local
to the file.

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."



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

* RE: Alpha linker problems
  2000-03-27  5:00     ` Stephen Williams
@ 2000-03-27  5:04       ` Greg Lindahl
  2000-03-27 21:23       ` Richard Henderson
  1 sibling, 0 replies; 12+ messages in thread
From: Greg Lindahl @ 2000-03-27  5:04 UTC (permalink / raw)
  To: axp-list

> Not as easy as it sounds.

I never said it was.

> I guess it's not clear to me whether static symbols make a difference or
not.

I think they don't count against the limit.

> Does you really mean that the *object file* is limited to 64K, or that the
> .got subsection for each object file is limited to 64K. You must mean the
> .got subsection is limited.

Each FILE has its own .got subsection. I don't see why gas could simply emit
multiple got subsections. From reading gld, it seems that the linker doesn't
mind if multiple files drive the .got total really large, so it's really a
per-object limit.

-- g


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

* Re: Alpha linker problems
  2000-03-27  5:00     ` Stephen Williams
  2000-03-27  5:04       ` Greg Lindahl
@ 2000-03-27 21:23       ` Richard Henderson
  1 sibling, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2000-03-27 21:23 UTC (permalink / raw)
  To: axp-list

On Sun, Mar 26, 2000 at 09:00:43PM -0800, Stephen Williams wrote:
> Does you really mean that the *object file* is limited to 64K, or that the
> .got subsection for each object file is limited to 64K. You must mean the
> .got subsection is limited.

Yes of course the later.

> What things go into the .got subsection? External symbols? 

Currently any symbol.  Though static symbols wouldn't have to
if I got off my ass and fixed gas then gcc.

> If I make some of the symbols static, will that keep them out of
> the .got subsection? As I said, if this is the case, I can arrange
> for my symbols to be made local to the file.

Can you arrange to put them in a structure?  E.g.

	static struct
	{
	  int foo, bar, baz;
	} G;

Now you've got one symbol instead of three.  Gcc can even generate
a bit better code with input like that.


r~


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

end of thread, other threads:[~2000-03-27 21:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-26 17:41 Alpha linker problems Stephen Williams
2000-03-26 20:01 ` Greg Lindahl
2000-03-26 21:27   ` Stephen Williams
2000-03-26 21:41     ` Rich Payne
2000-03-26 22:50     ` Greg Lindahl
2000-03-26 23:30       ` tibor
2000-03-27  2:27         ` Rich Payne
2000-03-27  2:40 ` Richard Henderson
2000-03-27  4:42   ` Greg Lindahl
2000-03-27  5:00     ` Stephen Williams
2000-03-27  5:04       ` Greg Lindahl
2000-03-27 21:23       ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox