Recent

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

Gizmo

  • Hero Member
  • *****
  • Posts: 714
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?
Lazarus 2.0.4 and fpc 3.0.4 - Linux Mint 19 LTS, Windows 10 64 and Mac OSX Catlina
Useful Page to remember : http://wiki.freepascal.org/Cross_compiling#From_Linux_x64_to_Linux_i386

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8780
  • 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: 714
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.
Lazarus 2.0.4 and fpc 3.0.4 - Linux Mint 19 LTS, Windows 10 64 and Mac OSX Catlina
Useful Page to remember : http://wiki.freepascal.org/Cross_compiling#From_Linux_x64_to_Linux_i386

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8780
  • 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