ld64 support for slidable static images -- _mh_execute_header --- src/ld/LinkEditClassic.hpp +++ src/ld/LinkEditClassic.hpp @@ -356,8 +356,9 @@ void SymbolTableAtom::addGlobal(const ld::Atom* atom, StringPoolAtom* pool) entry.set_n_type(N_EXT | N_SECT | N_PEXT); } else if ( (atom->symbolTableInclusion() == ld::Atom::symbolTableInAndNeverStrip) - && (atom->section().type() == ld::Section::typeMachHeader) ) { - // the __mh_execute_header is historical magic and must be an absolute symbol + && (atom->section().type() == ld::Section::typeMachHeader) + && !_options.positionIndependentExecutable() ) { + // the __mh_execute_header is historical magic in non-pie executabls and must be an absolute symbol entry.set_n_type(N_EXT | N_ABS); } }