Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

what about .a and .so files?

share|improve this question

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


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.