<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">ld64 support for slidable static images -- _mh_execute_header

&lt;rdar://problem/10280094&gt;

--- src/ld/LinkEditClassic.hpp
+++ src/ld/LinkEditClassic.hpp
@@ -356,8 +356,9 @@ void SymbolTableAtom&lt;A&gt;::addGlobal(const ld::Atom* atom, StringPoolAtom* pool)
 				entry.set_n_type(N_EXT | N_SECT | N_PEXT);
 		}
 		else if ( (atom-&gt;symbolTableInclusion() == ld::Atom::symbolTableInAndNeverStrip)
-					&amp;&amp; (atom-&gt;section().type() == ld::Section::typeMachHeader) ) {
-			// the __mh_execute_header is historical magic and must be an absolute symbol
+					&amp;&amp; (atom-&gt;section().type() == ld::Section::typeMachHeader) 
+					&amp;&amp; !_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);
 		}
 	}
</pre></body></html>