views:

38

answers:

1

I'm confused. I try in Linux on x86.

+1  A: 

PIC just makes live more simple for the loader since it only has to modify a few global addresses in the code. Non-PIC code just contains a lot more of these addresses, so the table with addresses which need relocation are bigger. But the loader must be able to relocate the code in either case (for example, to resolve the addresses of static/global variables and all function pointers).

Aaron Digulla
MUST??? usually this does not work at all
vitaly.v.ch
You always have some symbols which are accessed via their global address. These addresses must always be relocated. In the past, such code was often mapped to a fixed address but with the advent of buffer overflows, OSs will map an app to ever changing addresses to make these kinds of attacks harder.
Aaron Digulla