Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

what about .a and .so files?

share|improve this question

1 Answer 1

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.

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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