Operating System - HP-UX
1827728 Members
2730 Online
109968 Solutions
New Discussion

pic information in object files

 
SOLVED
Go to solution
messi_1
New Member

pic information in object files

How do I view the pic data information from object file's sections.

eg:

elfdump -s should show me picdata information in object file's section, if the it's compiled for PIC.
6 REPLIES 6
Dennis Handly
Acclaimed Contributor

Re: pic information in object files

What do you really want to know, whether it is compiled PIC?

footprints(1) will decode the info in "elfdump -dc".
messi_1
New Member

Re: pic information in object files

Hi Dennis,

Thanks for the answer.

elfdump -s
shows ".picdata" section on solaris platform if the library is compiled PIC.

Do we have a similar way to identify the Pic section in library file on hp-ux ?

Thanks,
Usha
Dennis Handly
Acclaimed Contributor

Re: pic information in object files

>Do we have a similar way to identify the PIC section in library file on HP-UX?

I assume you want to know if the code is PIC or not, not what's in .picdata?

(Or if the latter, you'll have to tell us what's there.)

Shlibs are PIC, no need to check.
The default on Integrity is PIC.

As to an object file, you could look at the relocations and using advanced AI technology make a guess.
messi_1
New Member

Re: pic information in object files


HI Dennis,

By examining the object code sections of library, can i determine if its compiled PIC.

eg: on solaris platforms, if my library is compiled PIC, then

elfdump -s

shows me ".picdata" section along with other sections like .text, .data, .BSS etc

So, similarly on hp-ux, can I examine my library object file sections and determine whether its compiled Pic


Thanks,
Usha
Dennis Handly
Acclaimed Contributor
Solution

Re: pic information in object files

>can I examine my library object file sections and determine whether its compiled PIC?

No, it isn't simple. Whether it is PIC or not is encoded in the relocations: elfdump -r

The obvious way is just link it and look for errors:
cc -b foo.o
messi_1
New Member

Re: pic information in object files

I will do as suggested!

Thanks Dennis.