I know that object files(.o) are always relocatable,

what about .a and .so files?

link|improve this question
feedback

1 Answer

A .a file is just an archive of other files. Typically those are .o files, to which you already know the answer. They don't have to be though - they don't have to be object code at all in fact - they can literally be any files you like.

A .so file has to be relocatable to work as it has to be able to be loaded at different addresses in different processes depending on what address is available at runtime.

link|improve this answer
So .a file is not ELF format,why can nm still deal with it? – linux Jul 13 '11 at 14:06
Because it has been taught how to read them... – TomH Jul 13 '11 at 14:43
What format is ar using? – linux Jul 13 '11 at 15:34
The ar archive format ;-) – TomH Jul 13 '11 at 15:52
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.