Re: When do I need PIC?

"joshc" <>
4 Aug 2006 16:37:55 -0400

          From comp.compilers

Related articles
When do I need PIC? (joshc) (2006-07-28)
Re: When do I need PIC? (Vincent Zweije) (2006-07-29)
Re: When do I need PIC? (joshc) (2006-07-31)
Re: When do I need PIC? (russell kym horsell) (2006-08-03)
Re: When do I need PIC? (joshc) (2006-08-04)
Re: When do I need PIC? (glen herrmannsfeldt) (2006-08-09)
| List of all articles for this month |

From: "joshc" <>
Newsgroups: comp.compilers
Date: 4 Aug 2006 16:37:55 -0400
References: 06-07-09206-07-116 06-08-006
Keywords: architecture, code
Posted-Date: 04 Aug 2006 16:37:55 EDT

> Your original question has pretty much been answered. But maybe you
> really are asking the quetion "how can I tell whether my code is
> already position independent?".

No, I already said I can look at the assembler listing and can easily
tell if the compiler generated code that is position independent. That
wasn't quite my question, but...

> The best idea would probably be to create an edit script (e.g.) to look
> at the asm output and extract "features" (a la AI probs) that indicate
> the code is NOT position indep. E.g. sometimes "@$" or somesuch indicates
> a ref to an absolute address. Most (all?) refs to abs addrs indicate non-PIC
> code. But there are bound to be a load of tricks.

I thank you for this part of your response. That is the insight I was
looking for. I was looking for the "style of C code that results in
being PIC" most of the time but as you and previous posters mentioned
this is highly architecture dependent. And with that, my original
question has now been answered.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.