This uses otool -vh
to print the mach header and look for the PIE
flag:
0otool -vh src/bitcoind
1Mach header
2 magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
3MH_MAGIC_64 X86_64 ALL LIB64 EXECUTE 24 2544 NOUNDEFS DYLDLINK TWOLEVEL WEAK_DEFINES BINDS_TO_WEAK PIE
From mach-o/loader.h
:
0#define MH_PIE 0x200000 /* When this bit is set, the OS will
1 load the main executable at a
2 random address. Only used in
3 MH_EXECUTE filetypes. */