This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: is -fPIC safe for executable programs, or must -fPIE be used?


Le 25/03/2016 20:04, Britton Kerin a Ãcrit :
      -pie
      --pic-executable     Create a position independent executable.
This is currently only supported on ELF platforms. Position
independent executables are similar to shared libraries in that they
are relocated by the dynamic linker to the virtual address the OS
chooses for them (which can vary between invocations). Like normal
dynamically linked executables they can be executed and symbols
defined in the executable cannot be overridden by shared libraries.

    Hello.

    Isn't there a contradiction in the sentence

  Like normal
dynamically linked executables they can be executed and symbols
defined in the executable cannot be overridden by shared libraries.

The first part of the sentence seeems to mean they can be dynamically linked (they are just abnormal dynamically linked programs) and the second part seems to mean the dynamic linking will fail -- my understanding of dynamic linking being that it relies precisely on overriding symbols.

    Thanks if you can clarify that.

    Didier


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]