Add an assert that this is only used with .o files.

I am not sure how to get a relocation in a .dylib, but this function would
return the wrong value if passed one.