Question

I am looking the options for Binary Encryption Code generation and found two options available that are PIC and PIE. I have tried for find the differences between both but didn't find suitable articles. If anybody can explain the difference with example with pros and corn or provide the link to the good article would be great to learn.

My basic motive is to protect the compiled code as ELF/PE format can be attacked by virus or it can be hacked or with the help of reverse techniques can re-produce code. Kindly also provide any other means for protection of compiled code from attacks and d-compling.

I am using GCC Compiler through Cygwin for building cross platform application.

Was it helpful?

Solution

From the gcc documentation:

-fpic
Generate position-independent code (PIC) suitable for use in a shared library...

-fpie
These options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables....

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top