<pre style='margin:0'>
Jeremy Huddleston Sequoia (jeremyhu) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/cb04343960f96b0452b3cf0cbe4bc667e3aa9294">https://github.com/macports/macports-ports/commit/cb04343960f96b0452b3cf0cbe4bc667e3aa9294</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit cb04343960f96b0452b3cf0cbe4bc667e3aa9294
</span>Author: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
AuthorDate: Sun Dec 25 22:23:51 2016 -0800
<span style='display:block; white-space:pre;color:#404040;'> ld64-127: Misc bug fixes pulled in from ld64-136
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
</span>---
devel/ld64/Portfile | 8 ++++-
devel/ld64/files/ld64-127-alignment_padding.patch | 15 ++++++++++
...ld64-127-filter_out_zero_length_functions.patch | 16 ++++++++++
devel/ld64/files/ld64-127-i386-reloc.patch | 15 ++++++++++
.../files/ld64-127-malformed_object_crash.patch | 15 ++++++++++
devel/ld64/files/ld64-127-no_ld_classic.patch | 35 ++++++++++++++++++++++
devel/ld64/files/ld64-127-static_slidable.patch | 18 +++++++++++
7 files changed, 121 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ld64/Portfile b/devel/ld64/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index d3e1d04..96f0a6a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/ld64/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ld64/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -74,7 +74,7 @@ subport ld64-127 {
</span> # XCode 4.2
# This was the last ld64 release that supported linking ppc executables.
version 127.2
<span style='display:block; white-space:pre;background:#ffe0e0;'>- revision 12
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision 13
</span>
set makefile "Makefile-127"
set ld64_ver 127
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -87,6 +87,12 @@ subport ld64-127 {
</span> ld64-127-cxx_initializer_order_and_sim.patch \
ld64-127-ppc.patch \
ld64-127-configured_architectures.patch \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ ld64-127-alignment_padding.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ld64-127-filter_out_zero_length_functions.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ld64-127-i386-reloc.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ld64-127-malformed_object_crash.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ld64-127-no_ld_classic.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ld64-127-static_slidable.patch \
</span> ld64-97-no-Availability.h.patch \
PR-12249048.patch \
PR-12057707.patch \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ld64/files/ld64-127-alignment_padding.patch b/devel/ld64/files/ld64-127-alignment_padding.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..09deae1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ld64/files/ld64-127-alignment_padding.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,15 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+loosen assertion on category size to allow for aligment padding
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+<rdar://problem/10272666>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/ld/passes/objc.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/ld/passes/objc.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -813,7 +813,7 @@ void OptimizeCategories<A>::doit(const Options& opts, ld::Internal& state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(categoryAtom != NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- assert(categoryAtom->size() == Category<A>::size());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(categoryAtom->size() >= Category<A>::size());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // ignore categories also in __objc_nlcatlist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ( nlcatListAtoms.count(categoryAtom) != 0 )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ld64/files/ld64-127-filter_out_zero_length_functions.patch b/devel/ld64/files/ld64-127-filter_out_zero_length_functions.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..32e8280
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ld64/files/ld64-127-filter_out_zero_length_functions.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,16 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+filter out zero length functions in LC_FUNCTION_STARTS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+<rdar://problem/10422823>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/ld/LinkEdit.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/ld/LinkEdit.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1332,6 +1332,9 @@ void FunctionStartsAtom<A>::encode() const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ std::vector<const ld::Atom*>& atoms = sect->atoms;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (std::vector<const ld::Atom*>::iterator ait = atoms.begin(); ait != atoms.end(); ++ait) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const ld::Atom* atom = *ait;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // <rdar://problem/10422823> filter out zero-length atoms, so LC_FUNCTION_STARTS address can't spill into next section
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ( atom->size() == 0 )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint64_t nextAddr = atom->finalAddress();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ( atom->isThumb() )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ nextAddr |= 1;
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ld64/files/ld64-127-i386-reloc.patch b/devel/ld64/files/ld64-127-i386-reloc.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..933a7ea
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ld64/files/ld64-127-i386-reloc.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,15 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Fix ld -r to process i386 relocs same as ld_classic
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/ld/LinkEditClassic.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/ld/LinkEditClassic.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1363,8 +1363,8 @@ void SectionRelocationsAtom<x86>::encodeSectionReloc(ld::Internal::FinalSection*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // regular pointer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( !external && (entry.toAddend != 0) ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // use scattered reloc is target offset is non-zero
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ( !external && (entry.toAddend != 0) && (entry.toTarget->symbolTableInclusion() != ld::Atom::symbolTableNotIn) ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // use scattered reloc if target offset is non-zero into named atom (5658046)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sreloc1->set_r_scattered(true);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sreloc1->set_r_pcrel(false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sreloc1->set_r_length(2);
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ld64/files/ld64-127-malformed_object_crash.patch b/devel/ld64/files/ld64-127-malformed_object_crash.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..52bea57
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ld64/files/ld64-127-malformed_object_crash.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,15 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+malformed .o file crashes/hangs linker
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+<rdar://problem/12501376>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/ld/parsers/macho_relocatable_file.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/ld/parsers/macho_relocatable_file.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -822,6 +822,8 @@ template <typename A>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const uint8_t* Atom<A>::contentPointer() const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const macho_section<P>* sct = this->sect().machoSection();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ( this->_objAddress > sct->addr() + sct->size() )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ throwf("malformed .o file, symbol has address 0x%0llX which is outside range of its section", (uint64_t)this->_objAddress);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint32_t fileOffset = sct->offset() - sct->addr() + this->_objAddress;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return this->sect().file().fileContent()+fileOffset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ld64/files/ld64-127-no_ld_classic.patch b/devel/ld64/files/ld64-127-no_ld_classic.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..d81400b
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ld64/files/ld64-127-no_ld_classic.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,35 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ld64 stop using ld_classic
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/ld/Options.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/ld/Options.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4047,30 +4047,6 @@ void Options::checkForClassic(int argc, const char* argv[])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // -dtrace only supported by new linker
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if( dtraceFound )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if( archFound ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch ( fArchitecture ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case CPU_TYPE_I386:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case CPU_TYPE_POWERPC:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( (staticFound || kextFound) && !newLinker ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // this environment variable will disable use of ld_classic for -static links
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( getenv("LD_NO_CLASSIC_LINKER_STATIC") == NULL ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- this->gotoClassicLinker(argc, argv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // work around for VSPTool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( staticFound )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- this->gotoClassicLinker(argc, argv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void Options::gotoClassicLinker(int argc, const char* argv[])
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ld64/files/ld64-127-static_slidable.patch b/devel/ld64/files/ld64-127-static_slidable.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..98733ac
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ld64/files/ld64-127-static_slidable.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,18 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ld64 support for slidable static images -- _mh_execute_header
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+<rdar://problem/10280094>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/ld/LinkEditClassic.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/ld/LinkEditClassic.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -356,8 +356,9 @@ void SymbolTableAtom<A>::addGlobal(const ld::Atom* atom, StringPoolAtom* pool)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry.set_n_type(N_EXT | N_SECT | N_PEXT);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if ( (atom->symbolTableInclusion() == ld::Atom::symbolTableInAndNeverStrip)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- && (atom->section().type() == ld::Section::typeMachHeader) ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // the __mh_execute_header is historical magic and must be an absolute symbol
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && (atom->section().type() == ld::Section::typeMachHeader)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && !_options.positionIndependentExecutable() ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // the __mh_execute_header is historical magic in non-pie executabls and must be an absolute symbol
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ entry.set_n_type(N_EXT | N_ABS);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span></pre><pre style='margin:0'>
</pre>