2 2008-07-10 Nick Kledzik <kledzik@apple.com>
4 * src/LTOReader.hpp: improve missing symbol error message
7 2008-07-08 Nick Kledzik <kledzik@apple.com>
9 <rdar://problem/6054476> ld: add support for mllvm LTO options
10 * src/Options.cpp: support -mllvm option
11 * src/LTOReader.hpp: call lto_codegen_debug_options() with -mllvm options
12 * src/ld.cpp: pass llvmOptions to optimize()
13 * src/Options.h: add fLLVMOptions
14 * src/ArchiveReader.hpp: add llvmOptions parameter to optimize()
15 * src/ObjectFile.h: add llvmOptions parameter to optimize()
16 * unit-tests/test-cases/lto-llvm-options: add test case
19 2008-06-04 Nick Kledzik <kledzik@apple.com>
21 * src/LTOReader.hpp: if lto_codegen_add_module() fails, add explanation to error message
23 2008-06-04 Nick Kledzik <kledzik@apple.com>
25 * src/ObjectFile.h: add deadAtoms parameter to optimize()
27 * src/ArchiveReader.hpp: ditto
28 * src/MachOReaderRelocatable.hpp: handle llvm use of 0x1B pointer encodings in CIEs
29 * src/LTOReader.hpp: make sure libLTO.dylib knows about any llvm symbol coalesced away
30 * unit-tests/test-cases/lto-weak-native-override: add test case
33 2008-06-04 Nick Kledzik <kledzik@apple.com>
35 <rdar://problem/5935600> LTO : 176.gcc and 177.mesa build failure at -O4
36 * src/LTOReader.hpp: make sure internal is returned by getAtoms()
37 * unit-tests/test-cases/lto-archive-dylib: update test case
40 2008-05-06 Nick Kledzik <kledzik@apple.com>
42 <rdar://problem/5905889> ARM ld should take W bit off of maxprot for __TEXT segment
43 * src/MachOWriterExecutable.hpp: for iPhone always set maxprot to be initprot in all segments
46 2008-05-06 Nick Kledzik <kledzik@apple.com>
48 <rdar://problem/5914343> encryptable images may not be signable
49 * src/MachOWriterExecutable.hpp: use minimum header padding when aligning __text section
52 ----- Tagged ld64-85 (Xcode 3.1)
54 2008-04-29 Nick Kledzik <kledzik@apple.com>
56 * ld64.xcodeproj/project.pbxproj: <llvm-c/lto.h> is moving from /usr/local/include to /Developer/usr/local/include
59 2008-04-29 Nick Kledzik <kledzik@apple.com>
61 <rdar://problem/5829579> ld doesn't honor "rightmost" -syslibroot argument
62 * src/Options.cpp: if last -syslibroot is /, then ignore all syslibroots
65 2008-04-29 Nick Kledzik <kledzik@apple.com>
67 <rdar://problem/5866582> GLRendererFloat has bad __eh_frame section caused by mixing llvm-gcc and gcc object files
68 * src/MachOReaderRelocatable.hpp: make all atoms in __eh_frame section have 1-byte alignment
69 * src/MachOWriterExecutable.hpp: make __eh_frame section have pointer sized alignment
72 2008-04-17 Nick Kledzik <kledzik@apple.com>
74 * src/MachOReaderRelocatable.hpp: better cpu subtype support
77 2008-04-14 Nick Kledzik <kledzik@apple.com>
79 <rdar://problem/5733759> ld64 has bad ARM branch island check
80 * src/MachOWriterExecutable.hpp: in addBranchIslands() don't force large arm programs to fail
83 2008-04-10 Nick Kledzik <kledzik@apple.com>
85 * src/MachOWriterExecutable.hpp: fix stubs used with lazy dylibs
88 ----- Tagged ld64-84.4
90 2008-04-10 Nick Kledzik <kledzik@apple.com>
92 <rdar://problem/5847206> SPEC2000/eon built with -mdynamic-no-pic won't run
93 * src/Architectures.hpp: added arm::kReadOnlyPointer
94 * src/MachOReaderRelocatable.hpp: generate arm::kReadOnlyPointer
95 * src/MachOWriterExecutable.hpp: use arm::kReadOnlyPointer
96 * src/machochecker.cpp: allow MH_PIE bit
97 * unit-tests/test-cases/switch-jump-table: added test cases
100 ----- Tagged ld64-84.3
102 2008-04-09 Nick Kledzik <kledzik@apple.com>
104 <rdar://problem/5852023> -undefined dynamic_lookup busted
105 * src/ld.cpp: don't create proxy atom when scanning for dylib duplicates
106 * unit-tests/test-cases/tentative-and-archive: use -undefined dynamic_lookup
109 ----- Tagged ld64-84.2
111 2008-04-04 Nick Kledzik <kledzik@apple.com>
113 * src/ld.cpp: don't add .eh symbols to symbol table in -r mode
114 * unit-tests/test-cases/eh-coalescing-r: update to test out of order coalescing
117 ----- Tagged ld64-84.1
119 2008-03-28 Nick Kledzik <kledzik@apple.com>
121 <rdar://problem/5720961> ld should prefer architecture-specific variant over generic in fat object file
122 * src/Options.cpp: fully process -arch arguments into fArchitecture and fSubArchitecture
123 * src/ld.cpp: when -arch with a subtype is used, try to find the exact subtype from fat files
124 * unit-tests/test-cases/cpu-sub-types-preference: added test cases for arm and ppc
129 2008-03-28 Nick Kledzik <kledzik@apple.com>
131 * src/LTOReader.hpp: don't print lto version, if lto is unavailable
134 2008-03-26 Nick Kledzik <kledzik@apple.com>
136 <rdar://problem/5575399> Add LD_WARN_COMMONS to BigBear builds
137 * src/Options.cpp: Add support for LD_WARN_FILE which copies all warnings to a side file
140 2008-03-26 Nick Kledzik <kledzik@apple.com>
142 <rdar://problem/5797713> Need encryption tag in mach-o file
143 <rdar://problem/5811920> linker should adjust arm final linked images so __text is never on the same page as the load commands
144 * src/MachOFileAbstraction.hpp: add support for encryption_info_command
145 * src/Options.cpp: add support for LD_NO_ENCRYPT and -no_encryption
146 * src/MachOWriterExecutable.hpp: add EncryptionLoadCommandsAtom
147 * src/machochecker.cpp: validate LC_ENCRYPTION_INFO
150 2008-03-25 Nick Kledzik <kledzik@apple.com>
152 <rdar://problem/5712533> ld64 does not recognize LLVM bitcode archive files
153 * src/MachOReaderArchive.hpp: renamed to src/ArchiveReader.hpp
154 * src/ArchiveReader.hpp: sniff each member and instantiate correct reader
155 * src/ld.cpp: rename mach_o::archive::Reader to archive::Reader
156 * ld64.xcodeproj/project.pbxproj: rename MachOReaderArchive.hpp to ArchiveReader.hpp
157 * unit-tests/test-cases/llvm-integration: added test case
160 2008-03-25 Nick Kledzik <kledzik@apple.com>
162 <rdar://problem/5771658> ld64 should switch to new libLTO.dylib interface
163 <rdar://problem/5675690> Produce llvm bc file in 'ld -r' mode if all .o files are llvm bc
164 * src/LTOReader.hpp: rewrite from LLVMReader.hpp to use new lto_* C interface
165 * unit-tests/test-cases/llvm-integration: update and comment
166 * ld64.xcodeproj/project.pbxproj: update to lazy load libLTO.dylib
167 * src/ld.cpp: rework and simplify Linker::optimize()
168 * src/ObjectDump.cpp: Add -nm option
171 2008-03-25 Nick Kledzik <kledzik@apple.com>
173 * src/MachOReaderRelocatable.cpp: Fix some .objc_class_name_ off by one problem
174 * src/MachOWriterExecutable.cpp: Fix some .objc_class_name_ off by one problem
177 2008-03-24 Nick Kledzik <kledzik@apple.com>
179 <rdar://problem/5814613> Xcode 3.1 breaks linkage of libgcj.9.dylib from gcc 4.3.0
180 * src/MachOWriterExecutable.cpp: Make sure all ivars in Writer are initialized.
183 2008-03-21 Nick Kledzik <kledzik@apple.com>
185 * src/Options.cpp: warn if -seg1addr value is not page aligned
188 2008-03-21 Nick Kledzik <kledzik@apple.com>
190 <rdar://problem/5806437> Move ARM support outside of __OPEN_SOURCE__
191 * src/ld.cpp: remove __OPEN_SOURCE__ around arm support
192 * src/LLVMReader.hpp: remove __OPEN_SOURCE__ around arm support
193 * src/MachOReaderDylib.hpp: remove __OPEN_SOURCE__ around arm support
194 * src/ObjectFile.h: remove __OPEN_SOURCE__ around arm support
195 * src/MachOReaderRelocatable.hpp: remove __OPEN_SOURCE__ around arm support
196 * src/OpaqueSection.hpp: Cover arm support inside __OPEN_SOURCE__ macro check
197 * src/MachOWriterExecutable.hpp: remove __OPEN_SOURCE__ around arm support
198 * src/ObjectDump.cpp: remove __OPEN_SOURCE__ around arm support
199 * ld64.xcodeproj/project.pbxproj: remove ARM_SUPPORT from config.h
202 ----- Tagged ld64-83.2
204 2008-03-15 Nick Kledzik <kledzik@apple.com>
206 <rdar://problem/5801620> ld64-83 removes OBJC_CLASS_$ symbols from projects, causes catastrophic results
207 * src/Options.cpp: restore "case CPU_TYPE_ARM" in switch statement for .objc_class symbols in .exp files
208 * unit-tests/test-cases/objc-exported_symbols_list: added test case
211 ----- Tagged ld64-83.1
213 2008-03-14 Nick Kledzik <kledzik@apple.com>
215 <rdar://problem/5800466> -iphone_version_min ==> -iphoneos_version_min
216 * src/Options.cpp: support -iphoneos_version_min as well
221 2008-03-10 Nick Kledzik <kledzik@apple.com>
223 <rdar://problem/5791543> ld needs to strip iphone_version_min option if invoking ld_classic
224 * src/Options.cpp: suppress -iphone_version_min from being passed to ld_classic
227 2008-03-04 Nick Kledzik <kledzik@apple.com>
229 <rdar://problem/4171253> ADOBE XCODE: Linker option to lazy load frameworks (cause dyld is too slow)
230 * src/MachOWriterExecutable.hpp: create lazy stubs and LC_LAZY_LOAD_DYLIB for lazy load dylibs
231 * src/Options.cpp: support -lazy-l, -lazy_library, and -lazy_framework
232 * src/MachOFileAbstraction.hpp: add LC_LAZY_LOAD_DYLIB and S_LAZY_DYLIB_SYMBOL_POINTERS until in cctools
233 * src/MachOReaderDylib.hpp: add isLazyLoadedDylib()
234 * src/ld.cpp: pass lazy helper atom to writer
235 * doc/man/man1/ld.1: document new options
236 * unit-tests/test-cases/lazy-dylib-objc: add test case
237 * unit-tests/test-cases/lazy-dylib: add test case
240 ----- Tagged ld64-82.7
242 2008-03-07 Nick Kledzik <kledzik@apple.com>
244 <rdar://problem/5787149> duplicate symbol literal-pointer@__OBJC@__message_refs@...
245 * src/MachOReaderRelocatable.hpp: AnonymousAtom from S_LITERAL_POINTERS section should be weak
246 * unit-tests/test-cases/objc-selector-coalescing: added test case
249 ----- Tagged ld64-82.6
251 2008-03-04 Nick Kledzik <kledzik@apple.com>
253 <rdar://problem/5779681> ld crashes building XsanFS for Snow Leopard Builds
254 * src/ld.cpp: add bool dylibsOnly parameter to addJustInTimeAtoms()
255 * unit-tests/test-cases/tentative-and-archive: added test case
257 2008-03-04 Nick Kledzik <kledzik@apple.com>
259 <rdar://problem/5775822> ld64 should not force building with gcc 4.0
260 * ld64.xcodeproj/project.pbxproj: change rules to use "system" compiler instead of 4.0
263 2008-02-29 Nick Kledzik <kledzik@apple.com>
265 <rdar://problem/5774730> Simulator frameworks are being build split-seg and not prebound
266 * src/Options.cpp: only splitseg if prebound
269 2008-02-29 Nick Kledzik <kledzik@apple.com>
271 <rdar://problem/5774231> Linker should not make GSYM debug note for .objc_category_* symbols
272 * src/ld.cpp: suppress GSYM debug notes for absolute symbols
273 * unit-tests/test-cases/objc-category-debug-notes: added test case
276 2008-02-29 Nick Kledzik <kledzik@apple.com>
278 <rdar://problem/5768970> non-ASCII CFString support is broken
279 * src/MachOReaderRelocatable.hpp: only name and coalesce cfstring constants if they use a __cstring
280 * unit-tests/test-cases/cfstring-utf16: add test case
283 2008-02-25 Nick Kledzik <kledzik@apple.com>
285 <rdar://problem/5366363> ld -r -x
286 * doc/man/man1/ld.1: update man page to explain -r -x produces auto-stripped labels
289 ----- Tagged ld64-82.5
291 2008-02-12 Nick Kledzik <kledzik@apple.com>
293 <rdar://problem/5738023> x86_64: -stack_size failure when large __bss is used
294 * src/ld.cpp: only move section already in __DATA segment to new __huge section
295 * unit-tests/test-cases/stack_size_no_addr: updated test case to add large bss section
298 ----- Tagged ld64-82.4
300 2008-02-06 Nick Kledzik <kledzik@apple.com>
302 <rdar://problem/5726215> comdat warnings with ld -r of C++ .o files
303 * unit-tests/test-cases/eh-coalescing-r: added test case
304 * src/ld.cpp: in ld -r mode don't warn about if .eh symbols are not static
307 2008-02-06 Devang Patel <dpatel@apple.com>
309 <rdar://problem/5724990> LTO of Bom framework with -dead_strip causes ld(1) crash
310 * src/LLVMReader.hpp: Check fAtom while determining LLVMReference target binding.
311 * unit-tests/test-cases/llvm-integration/Makefile: Add new test case.
312 * unit-tests/test-cases/llvm-integration/a15.c: New.
313 * unit-tests/test-cases/llvm-integration/b15.c: New.
314 * unit-tests/test-cases/llvm-integration/c15.c: New.
316 2008-02-05 Nick Kledzik <kledzik@apple.com>
318 * src/ld.cpp: fix for -arch ppc -mdynamic-no-pic -pie so PPC_RELOC_HA16 reloc is used
320 ----- Tagged ld64-82.3
322 2008-02-04 Nick Kledzik <kledzik@apple.com>
324 <rdar://problem/5721186> ld doesn't seem to understand $ld$add$os... and $ld$hide$os... for 10.6 moves
325 * src/ObjectFile.h: add 10.6
326 * src/Options.cpp: add 10.6 support
327 * src/MachOReaderDylib.hpp: recognize $os10.6$
330 ----- Tagged ld64-82.2
332 2008-01-30 Devang Patel <dpatel@apple.com>
334 <rdar://problem/5714833> Can't build 64-bit Intel binaries with LTO
335 <rdar://problem/5714787> ld64 fails to build with llvm-gcc-4.2
336 * src/LLVMReader.hpp: Fix character count typo in strncmp call.
337 Use const char * to initialize temp. string.
338 * ld64.xcodeproj/project.pbxproj: use $(DEVELOPER_DIR) in header search construction
339 instead of hard coding /Developer.
341 ----- Tagged ld64-82.1
343 2008-01-23 Nick Kledzik <kledzik@apple.com>
345 * src/MachOReaderRelocatable.hpp: don't bus error if S_LITERAL_POINTERS is missing relocs
348 2008-01-22 Nick Kledzik <kledzik@apple.com>
350 <rdar://problem/5695496> ld uses 32-bits in some places to hold addresses when parsing 64-bit mach-o files
351 * src/MachOReaderRelocatable.hpp: use AddrToAtomMap type that switch address to 64-bits for 64-bit archs
352 * src/MachOWriterExecutable.hpp: verify BR14 does not overflow for external relocs
353 * unit-tests/test-cases/relocs-c: update test case to slide addresses to verify x86_64 .o files
358 2008-01-18 Nick Kledzik <kledzik@apple.com>
360 <rdar://problem/5694612> Bad grammar used in ld warning: cannot exported hidden symbol
361 * src/ld.cpp: fix typo in warning string
364 2008-01-16 Nick Kledzik <kledzik@apple.com>
366 <rdar://problem/5565074> Bundle Loader does not work anymore when loader is a bundle
367 <rdar://problem/5590203> ld warns of incorrect architecture when linking a bundle to a bundle
368 * src/MachOReaderDylib.hpp: support linking against bundles via -bundle_loader. Clean up error messages
369 * unit-tests/test-cases/bundle_loader: update test case
372 2008-01-16 Nick Kledzik <kledzik@apple.com>
374 <rdar://problem/5366363> ld -r -x creates debug notes (stabs) when it should not with -x (keep only global symbols)
375 * src/Options.cpp: in reconfigureDefaults() if -r and -x then -S
378 2008-01-16 Nick Kledzik <kledzik@apple.com>
380 <rdar://problem/5566068> if ld crashes while writing output file, it should delete the half written file
381 * src/MachOWriterExecutable.hpp: wrap open/write/close in try block and add signal handlers all to delete
382 output file on failure.
385 2008-01-16 Devang Patel <dpatel@apple.com>
387 * src/LLVMReader.hpp: Use __gnu_cxx::hash_map instead of hash supported by LLVM.
390 2008-01-16 Nick Kledzik <kledzik@apple.com>
392 <rdar://problem/5593537> GC-supported library can't be linked into GC-required executable
393 * src/ld.cpp: loosen constraint that all objc code must be compiled with same GC settings and
394 allow gc-compatible code to be linked into anything.
395 * unit-tests/test-cases/objc-gc-checks: update test case
398 2008-01-15 Nick Kledzik <kledzik@apple.com>
400 <rdar://problem/5687976> no debug notes for custom named data
401 * src/ld.cpp: in synthesizeDebugNotes() check getSymbolTableInclusion() instead of for leading underscore
402 * unit-tests/test-cases/dwarf-debug-notes: update test case
404 ----- Tagged ld64-81.5
406 2008-01-14 Devang Patel <dpatel@apple.com>
408 <rdar://problem/5683813> llvm-gcc-4.2 fails to build Sqlite 3.5.4 with -O4
409 * src/LLVMReader.hpp: Resolve proxy references. Collect new unbounded references
411 * src/ld.cpp: Resolve additional unbounded references after optimization.
414 2008-01-14 Nick Kledzik <kledzik@apple.com>
416 <rdar://problem/5655246> PPC Leopard (Xcode 3.0) linker ld gets "Bus error" sometimes
417 * src/MachOReaderRelocatable.hpp: use same code as x86 to parse ppc and arm sect-diff relocs
418 * src/MachOWriterExecutable.hpp: use same code as x86 to write ppc and arm sect-diff relocs
421 2008-01-11 Nick Kledzik <kledzik@apple.com>
423 <rdar://problem/5637618> PPC Leopard (Xcode 3.0) linker ld reports "unknown scattered relocation type 4"
424 * src/MachOReaderRelocatable.hpp: add PPC_RELOC_HI16 to scattered reloc parsing
425 * unit-tests/test-cases/relocs-asm/relocs-asm.s: added tests for scattered hi/lo instructions
428 2008-01-11 Nick Kledzik <kledzik@apple.com>
430 * doc/man/man1/ld.1: add doc for -no_implicit_dylibs, -read_only_stubs, -slow_stubs, -interposable_list
433 2008-01-11 Nick Kledzik <kledzik@apple.com>
435 <rdar://problem/4800212> ld64(1) man page uses ambiguous term "suffix"
436 * doc/man/man1/ld.1: make meaning of "suffix" more explicit
439 2008-01-11 Nick Kledzik <kledzik@apple.com>
441 <rdar://problem/5633081> Obj-C Symbols in Leopard Can't Be Weak Linked
442 * src/MachOWriterExecutable.hpp: set weak and lazy attributes on dummy .objc_class_name undefines
443 to dylibs to support Mac OS X 10.3.x dyld
446 2008-01-11 Nick Kledzik <kledzik@apple.com>
448 <rdar://problem/5669751> Unknown error with linker (dyld: unknown external relocation type)
449 * src/ld.cpp: fix crash when SO stabs are not balanced
452 2008-01-11 Devang Patel <dpatel@apple.com>
454 <rdar://problem/5667433> LTO does not work if expected output is a dynamic library
455 * src/LLVMReader.hpp: Supply arguments describing output kind to optimizer. Communicate
458 2000-01-10 Nick Kledzik <kledzik@apple.com>
460 <rdar://problem/5680988> __cls_refs section is losing S_LITERAL_POINTERS section type
461 * src/MachOWriterExecutable.hpp: special case __cls_refs section
462 * unit-tests/test-cases/objc-literal-pointers: add test case
465 2008-01-03 Nick Kledzik <kledzik@apple.com>
467 <rdar://problem/5667688> wrong EH information might be used
468 Created new kGroupSubordinate reference kind to model group comdat. The "signature" atom
469 has kGroupSubordinate references to the other atoms in the group. If the signature atom
470 is coalesced away, the linker follows kGroupSubordinate references and throws away the
471 other members of the group.
472 * unit-tests/test-cases/eh-coalescing: added test case
473 * src/ld.cpp: added markDead() and use propagate to subordinates
474 * src/Architectures.hpp: added kGroupSubordinate
475 * src/MachOReaderRelocatable.hpp: add kGroupSubordinate reference from a function to its .eh atom
476 and if used, from .eh atom to its LSDA atom.
477 * src/MachOWriterExecutable.hpp: handle kGroupSubordinate like kNoFixUp
479 ----- Tagged ld64-81.4.1
481 2007-12-19 Devang Patel <dpatel@apple.com>
483 * src/LLVMReader.hpp: Add LLVM_LTO_VERSION #ifdef check.
485 2007-12-19 Devang Patel <dpatel@apple.com>
487 * src/LLVMReader.hpp: Add fOptimizer NULL check before calling printVersion().
489 2007-12-19 Devang Patel <dpatel@apple.com>
491 <rdar://problem/5655956> print LLVM LTO version number in verbose mode
492 * src/LLVMReader.hpp: Add printLLVMVersion() to print llvm version string in verbose mode.
493 * src/Options.cpp: Use printLLVMVersion() in verbose mode.
495 2007-12-19 Devang Patel <dpatel@apple.com>
497 <rdar://problem/5655956> print LLVM LTO version number in verbose mode
498 * src/Options.h: Add verbose() method to check fVerbose flag.
499 * src/LLVMReader.hpp: Print LLVM version string in verbose mode.
501 ----- Tagged ld64-81.4
503 2007-12-18 Devang Patel <dpatel@apple.com>
505 * src/LLVMReader.hpp: Invalidate input architecture when optimizer is not available.
507 ----- Tagged ld64-81.3
509 2007-12-17 Nick Kledzik <kledzik@apple.com>
511 * ld64.xcodeproj/project.pbxproj: remove extraneous header search paths
514 2007-12-17 Devang Patel <dpatel@apple.com>
516 * src/LLVMReader.hpp: Do not throw exception if LLVMReader is not able to
517 dlopen LTO library. Instead just flag input file as an invalid LLVM bitcode file.
520 2007-12-14 Nick Kledzik <kledzik@apple.com>
522 <rdar://problem/5645908> gcc DejaGnu failure: gcc.dg/20020312-2.c (test for excess errors) (-fstack-protector-all)
523 * src/MachOWriterExecutable.hpp: fix Writer<x86>::generatesExternalTextReloc() to allow text relocs
524 * unit-tests/test-cases/read-only-relocs: updated test case to link a dynamic main executable compiled with -static
527 2007-12-14 Devang Patel <dpatel@apple.com>
529 <rdar://problem/5648438> Enable Link Time Optimization in Opal
530 * src/LLVMReader.hpp: Locate LLVMlto.dylib relative to ld location in Developer folder.
531 * ld64.xcodeproj/project.pbxproj: Add {DEVELOPER_DIR}/usr/include in header search path.
532 * unit-tests/run-all-unit-tests: Set DYLD_FALLBACK_LIBRARY_PATH to find LLVMlto.dylib during unit testing.
533 * unit-tests/testcases/llvm-integration/Makefile: Point LLVMGCC and LLVMGXX to llvm-gcc-4.2 in Developer folder during unit testing.
536 2007-12-13 Nick Kledzik <kledzik@apple.com>
538 <rdar://problem/5645446> SWB: failures due to ld: pointer in read-only segment not allowed in slidable image, used in ...
539 * src/MachOReaderRelocatable.hpp: in Reader<x86>::addRelocReference() handle weak pc-rel 32-bit vanilla relocs properly
541 ----- Tagged ld64-81.2