Operating System - HP-UX
1753882 Members
7409 Online
108809 Solutions
New Discussion юеВ

Re: problesm with building object file

 
lara
Advisor

problesm with building object file

Hi,

I am trying build an object file using the -r option. If I use aCC -Wl,-r -o <*.o> then I get the following warning messages

/usr/ccs/bin/ld: (Warning) Shared library /usr/lib/libstd.sl referenced during relocatable link - ignored
/usr/ccs/bin/ld: (Warning) Shared library /usr/lib/libstream.sl referenced during relocatable link - ignored
/usr/ccs/bin/ld: (Warning) Shared library /usr/lib/libCsup.sl referenced during relocatable link - ignored
/usr/ccs/bin/ld: (Warning) Shared library /usr/lib/libm.sl referenced during relocatable link - ignored
/usr/ccs/bin/ld: (Warning) Shared library /usr/lib/libcl.sl referenced during relocatable link - ignored
...
...

If I use ld -r to generate the object file, it creates it, but when I do nm on the object file I get the following message
nm: cannot build list of section names.

I need to generate an object file on which I can do an nm since I need the symbol information to hide certain symbols when building a shared library with this object file.
BTW I tried with +nosectionmerge and I get the same message( nm: cannot build list of section names ) when I do nm.

Can anyone let me know why I get these messages and how to avoid it.

Thanks,
Lara





6 REPLIES 6
ranganath ramachandra
Esteemed Contributor

Re: problesm with building object file

can you provide your compile & link commands and the what strings of the compiler and linker?

also please check that all the object files are good with "odump -verifyall".
 
--
ranga
[i work for hpe]

Accept or Kudo

Zeev Schultz
Honored Contributor

Re: problesm with building object file

What linker patch do you have? (swlist -l product | grep ld)?
So computers don't think yet. At least not chess computers. - Seymour Cray
lara
Advisor

Re: problesm with building object file

swlist -v | grep ld gives me the following information

software_spec NetWorker,l=/,r=6.0.2.Build.251,a=HP-UX_11.XX_7XX/8XX
revision 6.0.2.Build.251
title ld(1) and linker tools cumulative patch
description "Patch PHSS_26262: ld(1) and linker tools cumulative patch"


and aCC version is
aCC: HP ANSI C++ B3910B A.03.37

I compile all the object files with +Z option and for the linker I just use -r option.

Thanks
lara
Advisor

Re: problesm with building object file

Hi,

I did a few more experiment today.
1. The warning messages seems to be due to aCC automatically including the system libraries in the link line when the ld is invoked through aCC( Even though the ld option is to build a object file ).
So to avoid it, I called ld directly and created the object file. However, I still got the same message when I tried to do a nm on the object file created.( nm: cannot build list of section names )
However, If I limit the number of object files included in the ld -r link line, then Iam able to get object files on which Iam able to do nm. However, I this method I endup creating multiple .o file instead of a single .o file.
Does anyone know if there is a limitation to how big the object file can be or is there an option I need to specify while generating large object file( the file size is around 300MB). Iam able to do this without any problem on solaris and linux platforms.
ranganath ramachandra
Esteemed Contributor

Re: problesm with building object file

if your only problem is running nm, you can use "odump -sym" on the object file.
 
--
ranga
[i work for hpe]

Accept or Kudo

lara
Advisor

Re: problesm with building object file

Hi,

I found that nm seems to have a problem with the large files. If I build a release version( with no debug information ), then nm is able to display the symbols.