Recent

Author Topic: link the Linux binaries with -z relro  (Read 2621 times)

Gizmo

  • Hero Member
  • *****
  • Posts: 831
link the Linux binaries with -z relro
« on: December 17, 2015, 10:18:34 pm »
Someone on Github has asked me the following about one of my projects:

Quote
Is it possible to link the Linux binaries with -z relro? When using gcc that would be done by adding -Wl,-z,relro to the LDFLAGS (see https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-Wl.2C-z.2Crelro).

Can anyone help me with understanding what that means, and whether it is possible using Lazarus 1.4.4 and FPC 2.6.4?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: link the Linux binaries with -z relro
« Reply #1 on: December 17, 2015, 10:41:25 pm »
FPC adds to the linker commandline via the -k parameter:

-k"-z zelro"  or -k-z  -kzelro

Gizmo

  • Hero Member
  • *****
  • Posts: 831
Re: link the Linux binaries with -z relro
« Reply #2 on: December 18, 2015, 09:24:52 am »
Thanks for the help. I build my programs using Lazarus itself (f9 etc) so I assume I need to add this is the compiler options of Lazarus?  Is that right? And can you tell me what it actually achieves? I'm still unclear as to the purpose of it.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: link the Linux binaries with -z relro
« Reply #3 on: December 18, 2015, 09:38:45 am »
No idea, just look in the manual of LD.


 

TinyPortal © 2005-2018