Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - GOLD linker for QNX: (15 Items)
   
GOLD linker for QNX  
Hello

I noticed the gold linker is checked in to the binutils source tree.  Is this something that could be compiled for QNX 6
.5.0 SP1? 

Thanks,
Rodney
Re: GOLD linker for QNX  
Yes, it should work on 6.5.0SP1

Regards,

Ryan Mansfield
Re: GOLD linker for QNX  
Hey Ryan

So if I build it, would it get around the 4 GB link limit that the default linker has? 

Thanks,
Rodney

Re: GOLD linker for QNX  
If won't get around the limitations of the 32bit vaddrs, but gold does 
seem to use less memory than the BFD linker. We've hit cases linking 
large C++ projects (e.g. webkit or chromium), where gold used much less 
and bfd was exhausting the memory on the system.

Regards,

Ryan Mansfield
On 15-07-15 09:19 AM, Rodney Dowdall wrote:
> Hey Ryan
>
> So if I build it, would it get around the 4 GB link limit that the default linker has?
>
> Thanks,
> Rodney
>
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post114127
> To cancel your subscription to this discussion, please e-mail general-toolchain-unsubscribe@community.qnx.com
>
Re: GOLD linker for QNX  
Attached is a Linux x86_64 hosted bfd and gold ld for 6.5.0SP1. Let me know if you have any problems.

Regards,

Ryan Mansfield
Attachment: Text ld.tar.gz 3.72 MB
Re: GOLD linker for QNX  
Thanks Ryan.  I'll give these a try and let you know how it goes. 

Re: GOLD linker for QNX  
Hello Ryan

The 64 bit linker worked.  I am not sure if the GOLD Linker worked.  I wasn't sure how to tell qcc how to use the gold 
linker.  I tried just linking i486-pc-nto-qnx6.5.0-ld to ntox86-ld.gold and rerunning my link command, but it still gave
 me the exhausted memory error.  So either, it doesn't work, or I didn't set it up properly.  I just copied the i486-pc-
nto-qnx6.5.0-ld over top of the link to get it go with the 64 bit one. 

Does the -fuse-ld=gold work with gcc? 

Thanks,
Rodney
Re: GOLD linker for QNX  
-fuse-ld=gold wasn't supported in gcc 4.4. If you're using the 4.8 
packages on foundry, it should support -fuse-ld=gold. You should be able 
to check by doing -v and seeing which underlying linker is being invoked.

Regards,

Ryan Mansfield
Re: GOLD linker for QNX  
Hello Ryan

Just to follow up, the -fuse-ld=gold did work, and the gold linker was able to link the shared object.  

Now that I have it linked though, there isn't much that I can do with it.  Most of the tools link ntox86-strip and ntx86
-objdump report the file as being truncated.  I had to use the strip utility from linux to strip the library down so 
that I could run it on the target. 

Once I got it running on the target, I tried to connect with it with gdb, but it has a problem with the shared object as
 well and says that the file is truncated.

I tried the following sequence thinking that loading the sym file wouldn't have the size limit on it:

objcopy --only-keep-debug mylib.so mylib.so.sym
strip --strip-all -R .ident -R .comment mylib.so
ntox86-objcopy --only-keep-debug mylib.so mylib.so.sym

but gdb can't load the sym file either. 

I'm compiling my library with the following options to lower the size:

-V4.8.3,gcc_ntox86_gpp -lang-c++ -fuse-ld=gold -g -Os -fno-rtti -Wformat -Wformat-security -Werror=format-security -Wl,-
-no-keep-memory -fmessage-length=0 -Wl,--warn-shared-textrel -Wa,--compress-debug-sections

Just wondering if there is anything else I can do to work around the issue. 
Re: GOLD linker for QNX  
Last week I played with the gold linker, kind of making it the default by overwritting stuff (sound of mad scientist 
rubbing his/jher hand),  One of the target of my diabolical plan was ntox86-ld !  Seems to work fine for a week but 
today I was building images and some of them ended up being 130M instead of 2Meg.   Sound of ballon deflating.


  Offset   Size    Entry   Ramoff Target=Host
  400000    440        0      --- ./x86/boot/sys/bios.boot
  400440    100     ----      --- Startup-header
  400540  14960   404e38      --- /tmp/fileKgYDol  ########## It's this guy that was WAY to big. (here it's ok )
  414a60     5c     ----      --- Image-header
  414abc    e04     ----      --- Image-directory
  4158c0      0     ----      --- proc/boot/unlink_list=/tmp/f
Re: GOLD linker for QNX  
From the sounds of it, it's the 32bit tools that are getting tripped up on the resulting file. Something about the file 
must need the extra virtual address space to play with.

 Unfortunately we don't have 64bit host packages up on foundry.
Re: GOLD linker for QNX  
Try this. It's a local build of gdb-7.6 from the svn repo for a 64bit linux host.
Attachment: Text ntox86-gdb.tgz 1.46 MB
Re: GOLD linker for QNX  
> Try this. It's a local build of gdb-7.6 from the svn repo for a 64bit linux 
> host.

I'm I right in assuming that's in regard to Rodney's post (From july), and NOT about the mkefs issue
Re: GOLD linker for QNX  
Yup. It seems I didn't realize how old the thread was.
Re: GOLD linker for QNX  
> Attached is a Linux x86_64 hosted bfd and gold ld for 6.5.0SP1. Let me know if
>  you have any problems.
> 
Hi,

Any hope of getting the lto 64 bit plugin, that goes along with gold ld ?

> Regards,
> 
> Ryan Mansfield