Recent

Author Topic: [Solved] Fix hardening-no-pie with fpc > 3.0.4  (Read 15576 times)

PascalDragon

  • Hero Member
  • *****
  • Posts: 5444
  • Compiler Developer
Re: [Solved] Fix hardening-no-pie with fpc > 3.0.4
« Reply #30 on: November 07, 2021, 10:30:04 pm »
In Ubuntu I get this for file ./executable:
   ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.4.0, stripped
In Debian:
  ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.4.0, stripped

That is VERY strange, are you sure it is the same file?

The explorer of Debian LXQt is also calling it a shared library.

Yes, I know, I find it strange too.
If you take a look into /usr/sbin/ directory, all the executables are called "Shared Library".
In fact they are PIE executables, not libraries (or maybe a PIE executable is called shared library by the purists).
See picture of my /usr/sbin/

Please note that for ELF binaries (e.g. Linux and the BSDs) Position Independant Executables are in fact shared libraries on the binary level. The dynamic linker does the necessary “magic” to turn the library into an executable upon launch.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: [Solved] Fix hardening-no-pie with fpc > 3.0.4
« Reply #31 on: November 08, 2021, 12:19:55 am »
I noted a few posts back that Ubuntu behaves differently from Debian, I suspected it was the binutils.  Using same recipe exactly, Ubuntu 20.40 does not make a PIE. But, as a seeming separate thing, Ubuntu does not report PIE using the file command, even on a binary that we know is PIE (made on Debian).

I test against Bullseye which is a newer release than U20.04, perhaps the newer ubuntu is more cooperative ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018