summaryrefslogtreecommitdiffstats
path: root/lld/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Change default output section type to SHT_PROGBITSAndrew Ng2019-04-236-9/+44
| | | | | | | | | | | | This fixes an issue where a symbol only section at the start of a PT_LOAD segment, causes incorrect alignment of the file offset for the start of the segment which results in the output of an invalid ELF. SHT_PROGBITS was the default output section type in the past. Differential Revision: https://reviews.llvm.org/D60131 llvm-svn: 358981
* [LLD][COFF] Fix /linkrepro with output options that take a filename or pathAlexandre Ganea2019-04-231-1/+14
| | | | | | | | The following options: /pdb, /out or /implib now emit in the repro.tar/response.txt only a filename stripped from its path, to avoid non-existent paths on the reproducer's machine. Differential Revision: https://reviews.llvm.org/D59530 llvm-svn: 358980
* [PPC][PPC64] Improve some llvm-objdump -d -D testsFangrui Song2019-04-2316-325/+261
| | | | | | | | | | | | | | | | | | | | | Various improvement: Some offsets in disassembly are incorrect after several layout adjustment. Fix them. llvm-objdump -D should not be used. -D dumps unrelated non-text sections. Replace them with llvm-objdump -d, llvm-readelf -x, etc Many llvm-objdump -d tests use {{.*}} . Add the option --no-show-raw-insn to avoid check hex bytes. ppc64-long-branch.s does not need a shared object. Delete it. Make ppc64-ifunc.s check 2 ifuncs. Reviewers: ruiu, espindola Subscribers: emaste, nemanjai, arichardson, kbarton, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60998 llvm-svn: 358975
* [LLD][ELF] - Fix mips-invalid-options-descriptor.s test case and convert to ↵George Rimar2019-04-233-5/+21
| | | | | | | | | | | | | | YAML. It was initially introduced in D25229 to report the "zero option descriptor size" error message. In following commits it was broken and did not report this error anymore. I think that happened because elf object was a result of fuzzing and it was broken in many ways. This patch converts this test to a YAML, removes a binary and hence fixes the original intention. llvm-svn: 358972
* [LLD][ELF] - Remove multiple-eh-relocs.elf binary from the inputs. NFCI.George Rimar2019-04-233-4/+29
| | | | | | Introduced multiple-relocations-sections.test based on YAML instead. llvm-svn: 358966
* [LLD][ELF] - Update test case after llvm-mc change.George Rimar2019-04-231-1/+1
| | | | | | | rL358960 "[llvm-mc] - Properly set the the address align field of the compressed sections." changed the sh_addralign field of the "zlib" compressed debug sections. llvm-svn: 358961
* [PPC64] Allow R_PPC64_DTPREL* to preemptable local-dynamic symbolsFangrui Song2019-04-231-0/+35
| | | | | | | | Similar to D60945. Differential Revision: https://reviews.llvm.org/D60994 llvm-svn: 358950
* [WebAssembly] Error on relocations against undefined data symbols.Sam Clegg2019-04-221-2/+4
| | | | | | | | | | | | | | | | | We can't (currently) meaningfully resolve certain types of relocations against undefined data symbols. Previously when `--allow-undefined` was used we were treating such relocation much like weak data symbols and simply inserting zeros. This change turns such use cases in to an error. This means that `--allow-undefined` is no longer effective for data symbols. Fixes https://bugs.llvm.org/show_bug.cgi?id=40364 Differential Revision: https://reviews.llvm.org/D60882 llvm-svn: 358899
* [LLD][ELF] - Remove a binary from the inputs. NFCI.George Rimar2019-04-223-4/+16
| | | | | | | section-index.elf was removed and the corresponding test was replaced with a yaml2obj based test. llvm-svn: 358889
* [LLD][ELF] - Do not forget to use ch_addralign field after decompressing the ↵George Rimar2019-04-221-0/+67
| | | | | | | | | | | | | sections. LLD did not use ELF::Chdr::ch_addralign for decompressed sections. This resulted in a broken output. Fixes https://bugs.llvm.org/show_bug.cgi?id=40482. Differential revision: https://reviews.llvm.org/D60959 llvm-svn: 358885
* [LLD][ELF] - Handle quoted strings in the linker scripts correctly.George Rimar2019-04-221-0/+13
| | | | | | | | | | | | | | This is the https://bugs.llvm.org/show_bug.cgi?id=41356, Seems it is kind of unusual case but it is possible to have sections that require quotes for their namings. Like "aaa bbb". This patch adds support for those. Differential revision: https://reviews.llvm.org/D60901 llvm-svn: 358874
* [ELF][X86] Allow R_386_TLS_LDO_32 and R_X86_64_DTPOFF{32,64} to preemptable ↵Fangrui Song2019-04-222-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | local-dynamic symbols Summary: Fixes PR35242. A simplified reproduce: thread_local int i; int f() { return i; } % {g++,clang++} -fPIC -shared -ftls-model=local-dynamic -fuse-ld=lld a.cc ld.lld: error: can't create dynamic relocation R_X86_64_DTPOFF32 against symbol: i in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output In isStaticLinkTimeConstant(), Syn.IsPreemptible is true, so it is not seen as a constant. The error is then issued in processRelocAux(). A symbol of the local-dynamic TLS model cannot be preempted but it can preempt symbols of the global-dynamic TLS model in other DSOs. So it makes some sense that the variable is not static. This patch fixes the linking error by changing getRelExpr() on R_386_TLS_LDO_32 and R_X86_64_DTPOFF{32,64} from R_ABS to R_DTPREL. R_PPC64_DTPREL_* and R_MIPS_TLS_DTPREL_* need similar fixes, but they are not handled in this patch. As a bonus, we use `if (Expr == R_ABS && !Config->Shared)` to find ld-to-le opportunities. R_ABS is overloaded here for such STT_TLS symbols. A dedicated R_DTPREL is clearer. Differential Revision: https://reviews.llvm.org/D60945 llvm-svn: 358870
* [LLD][ELF] - Fix mistype. NFC.George Rimar2019-04-201-1/+1
| | | | | | | Change the tripple name from aarch64-linux-gnux to -triple=aarch64-linux-gnu llvm-svn: 358810
* [WebAssembly] Emit the DataCount section when bulk memory is enabledThomas Lively2019-04-191-0/+16
| | | | | | | | | | | | | | | | | | Summary: The DataCount section is necessary for the bulk memory operations memory.init and data.drop to validate, but it is not recognized by engines that do not support bulk memory, so emit the section only if bulk-memory is enabled. Reviewers: aheejin, dschuff, sbc100 Subscribers: jgravelle-google, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60637 llvm-svn: 358798
* [MinGW] Add an --appcontainer flag, passed through to lld-linkMartin Storsjo2019-04-191-0/+4
| | | | | | | | | GNU ld doesn't have such a flag though, so this is a lld specific option. Differential Revision: https://reviews.llvm.org/D60860 llvm-svn: 358759
* [llvm] Prevent duplicate files in debug line header in dwarf 5: another attemptAli Tamur2019-04-192-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another attempt to land the changes in debug line header to prevent duplicate files in Dwarf 5. I rolled back my previous commit because of a mistake in generating the object file in a test. Meanwhile, I addressed some offline comments and changed the implementation; the largest difference is that MCDwarfLineTableHeader does not keep DwarfVersion but gets it as a parameter. I also merged the patch to fix two lld tests that will strt to fail into this patch. Original Commit: https://reviews.llvm.org/D59515 Original Message: Motivation: In previous dwarf versions, file name indexes started from 1, and the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes the primary source file to be explicitly given an entry with an index number 0. The current implementation honors the specification by just duplicating the main source file, once with index number 0, and later maybe with another index number. While this is compliant with the letter of the standard, the duplication causes problems for consumers of this information such as lldb. (Some files are duplicated, where only some of them have a line table although all refer to the same file) With this change, dwarf 5 debug line section files always start from 0, and the zeroth entry is not duplicated whenever possible. This requires different handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5) However, I think the minor complication is worth it, because it enables all consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the file name list homogenously. llvm-svn: 358732
* [LLD][ELF] - Convert out-of-order-section-in-region.s to *.test. NFCI.George Rimar2019-04-182-22/+20
| | | | | | This is consistent with the our others tests that has large scripts. llvm-svn: 358659
* [LLD][ELF] - A fix for "linker script assignment loses relative nature of ↵George Rimar2019-04-182-15/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | section" bug. This is https://bugs.llvm.org//show_bug.cgi?id=39857. I added the comment with much more details to the bug page, the short version is below. The following script and code demonstrates the issue: aliasto__text = __text; SECTIONS { .text 0x1000 : { __text = . ; *(.text) } } ... call aliasto__text LLD fails with "cannot refer to absolute symbol: aliasto__text" error. It happens because at the moment of scanning the relocations we do not yet assign the correct/final/any section value for the symbol aliasto__text. I made a change to Relocations.cpp to fix that. Also, I had to remove the symbol-location.s test case completely, because now it does not trigger any error. Since now all linker scripts symbols are resolved to constants, no errors can be triggered at all it seems. I checked that it is consistent with the behavior of bfd and gold (they do not trigger errors for the case from symbol-location.s), so it should be OK. I.e. at least it is probably not the best possible, but natural behavior we obtained. Differential revision: https://reviews.llvm.org/D55423 llvm-svn: 358652
* [ELF] Respect NonAlloc when copying flags from the previous sectionsFangrui Song2019-04-181-0/+4
| | | | | | | | | | | | | | | | Summary: If the output section contains only symbol assignments, we copy flags from the previous sections. Don't set SHF_ALLOC if NonAlloc is true. We also have to change the type from SHT_NOBITS to SHT_PROGBITS. In ld.bfd, bfd_elf_get_default_section_type maps non-alloctable sections to SHT_PROGBITS. Non-alloctable SHT_NOBITS sections do not make sense. Fixes PR38626 Differential Revision: https://reviews.llvm.org/D59986 llvm-svn: 358650
* [LLD][ELF] - Fix the different behavior of the linker script symbols on ↵George Rimar2019-04-181-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | different platforms. This generalizes code and also fixes the broken behavior shown in one of our test cases for some targets, like x86-64. The issue occurs when the forward declarations are used in the script. One of the samples is: SECTIONS { foo = ADDR(.text) - ABSOLUTE(ADDR(.text)); }; In that case, we have a broken output when output target does not use thunks. That happens because thunks creating code (called from maybeAddThunks) calls Script->assignAddresses() at least one more time, what fixups the values. As a result final symbols values can be different on AArch64 and x86, for example. In this patch, I generalize and rename maybeAddThunks to finalizeAddressDependentContent and now it is used and called by all targets. Differential revision: https://reviews.llvm.org/D55550 llvm-svn: 358646
* lld: elf: Fix sections with explict addresses in regionsRui Ueyama2019-04-181-0/+22
| | | | | | | | | | | | | | | | | | | | | | | Patch by Gabriel Smith. The address for a section would be evaluated before the region was switched to. Because of this, the position within the region would not be updated. After the region is swapped to the dot would be set to the out of date position within the region, undoing the section address evaluation. To fix this, the region is swapped to before the section's address is evaluated. As part of the fallout of this, expandMemoryRegions needed to be gated in setDot on the condition that the evaluated address is less than the dot. This is for the case where sections are not listed from lowest address to highest address. Finally, a test for the case where sections are listed "out of order" was added. Differential Revision: https://reviews.llvm.org/D60744 llvm-svn: 358638
* lld: Fix initial Mach-O load commands size calculation omitting ↵Rui Ueyama2019-04-171-0/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LC_FUNCTION_STARTS Patch by Nicholas Allegra. The Mach-O writer calculates the size of load commands multiple times. First, Util::assignAddressesToSections() (in MachONormalizedFileFromAtoms.cpp) calculates the size using headerAndLoadCommandsSize() (in MachONormalizedFileBinaryWriter.cpp), which creates a temporary MachOFileLayout for the NormalizedFile, only to retrieve its headerAndLoadCommandsSize. Later, writeBinary() (in MachONormalizedFileBinaryWriter.cpp) creates a new layout and uses the offsets from that layout to actually write out everything in the NormalizedFile. But the NormalizedFile changes between the first computation and the second. When Util::assignAddressesToSections is called, file.functionStarts is always empty because Util::addFunctionStarts has not yet been called. Yet MachOFileLayout decides whether to include a LC_FUNCTION_STARTS command based on whether file.functionStarts is nonempty. Therefore, the initial computation always omits it. Because padding for the __TEXT segment (to make its size a multiple of the page size) is added between the load commands and the first section, LLD still generates a valid binary as long as the amount of padding happens to be large enough to fit LC_FUNCTION_STARTS command, which it usually is. However, it's easy to reproduce the issue by adding a section of a precise size. Given foo.c: __attribute__((section("__TEXT,__foo"))) char foo[0xd78] = {0}; Run: clang -dynamiclib -o foo.dylib foo.c -fuse-ld=lld -install_name /usr/lib/foo.dylib otool -lvv foo.dylib This should produce: truncated or malformed object (offset field of section 1 in LC_SEGMENT_64 command 0 not past the headers of the file) This commit: - Changes MachOFileLayout to always assume LC_FUNCTION_STARTS is present for the initial computation, as long as generating LC_FUNCTION_STARTS is enabled. It would be slightly better to check whether there are actually any functions, since no LC_FUNCTION_STARTS will be generated if not, but it doesn't cause a problem if the initial computation is too high. - Adds a test. - Adds an assert in MachOFileLayout::writeSectionContent() that we are not writing section content into the load commands region (which would happen if the offset was calculated too low due to the initial load commands size calculation being too low). Adds an assert in MachOFileLayout::writeLoadCommands to validate a similar situation where two size-of-load-commands computations are expected to be equivalent. llvm-svn: 358545
* [MachO] Add -macho to llvm-objdump commandsFangrui Song2019-04-164-4/+4
| | | | llvm-svn: 358473
* Fix test on Windows that uses a different path separator character.Douglas Yung2019-04-151-6/+6
| | | | llvm-svn: 358453
* [LLD][COFF] use offset in archive to disambiguate archive membersBob Haarman2019-04-152-4/+33
| | | | | | | | | | | | | | | | | | | | | Summary: Archives can contain multiple members with the same name. This would cause ThinLTO links to fail ("Expected at most one ThinLTO module per bitcode file"). This change implements the same strategy we use in the ELF linker: make the offset in the archive part of the module name so that names are unique. Reviewers: pcc, mehdi_amini, ruiu Reviewed By: ruiu Subscribers: eraman, steven_wu, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60549 llvm-svn: 358440
* [COFF] Link crtend.o as the last object fileMartin Storsjo2019-04-153-0/+36
| | | | | | | | | | | | | | | | | | When faced with command line options such as "crtbegin.o appmain.o -lsomelib crtend.o", GNU ld pulls in all necessary object files from somelib before proceeding to crtend.o. LLD operates differently, only loading object files from any referenced static libraries after processing all input object files. This uses a similar hack as in the ELF linker. Here, it moves crtend.o to the end of the vector of object files. This makes sure that terminator chunks for sections such as .eh_frame gets ordered last, fixing DWARF exception handling for libgcc and gcc's crtend.o. Differential Revision: https://reviews.llvm.org/D60628 llvm-svn: 358394
* [ELF] Fix typo: .symtab_shndxr -> .symtab_shndxFangrui Song2019-04-122-8/+8
| | | | | | | | The typo was introduced to llvm MC in rL204769 (fixed in rL358247) and then to lld. Also, for relocatable-many-sections.s, the size of .symtab changed at some point and the formula needs update. llvm-svn: 358248
* [WebAssembly] Assign GOT entries symbols used in data relocationsSam Clegg2019-04-101-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D60492 llvm-svn: 358090
* [llvm-readobj] Should declare `ListScope` for `verneed` entries.Xing GUO2019-04-102-30/+36
| | | | | | | | | | | | | | | | Summary: YAML mappings require keys to be unique. See: https://yaml.org/spec/1.2/spec.html#id2764652 Reviewers: jhenderson, grimar, rupprecht, espindola, ruiu Reviewed By: ruiu Subscribers: ruiu, emaste, arichardson, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60438 llvm-svn: 358078
* Discard debuginfo for object files empty after GCRui Ueyama2019-04-102-0/+17
| | | | | | | | | | | | | | | | | | | | | | Patch by Robert O'Callahan. Rust projects tend to link in all object files from all dependent libraries and rely on --gc-sections to strip unused code and data. Unfortunately --gc-sections doesn't currently strip any debuginfo associated with GC'ed sections, so lld links in the full debuginfo from all dependencies even if almost all that code has been discarded. See https://github.com/rust-lang/rust/issues/56068 for some details. Properly stripping debuginfo for discarded sections would be difficult, but a simple approach that helps significantly is to mark debuginfo sections as live only if their associated object file has at least one live code/data section. This patch does that. In a (contrived but not totally artificial) Rust testcase linked above, it reduces the final binary size from 46MB to 5.1MB. Differential Revision: https://reviews.llvm.org/D54747 llvm-svn: 358069
* Move tests in r357996 to correct location within monorepoChih-Mao Chen2019-04-095-0/+179
| | | | llvm-svn: 357997
* [RISCV] Rewrite tests to use llvm-mc/llvm-objdumpChih-Mao Chen2019-04-096-651/+0
| | | | | | | | | | | Previously the tests in lld for RISC-V were given in yaml format as LLVM's RISC-V assembler support was incomplete. Now that the assembler/disassembler has matured we can rewrite all tests to use LLVM's tools. Differential Revision: https://reviews.llvm.org/D60415 llvm-svn: 357996
* [WebAssembly] Ensure ArchiveName is set even in the presence of --whole-archive.Sam Clegg2019-04-091-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D60431 llvm-svn: 357966
* ELF: Move verneed tracking data structures out of VersionNeedSection.Peter Collingbourne2019-04-081-2/+2
| | | | | | | | | | | | | | | | For partitions I intend to use the same set of version indexes in each partition for simplicity. Since each partition will need its own VersionNeedSection this will require moving the verneed tracking out of VersionNeedSection. The way I've done this is to move most of the tracking into SharedFile. What will eventually become the per-partition tracking still lives in VersionNeedSection. As a bonus the code gets a little simpler and more consistent with how we handle verdef. Differential Revision: https://reviews.llvm.org/D60307 llvm-svn: 357926
* Fix -emit-reloc against local symbols.Rui Ueyama2019-04-081-0/+14
| | | | | | | | | | | | | | | | Previously, we drop symbols starting with .L from the symbol table, so if there is a relocation that refers a .L symbol, it ended up referencing a null -- which happened to be interpreted as an absolute symbol. This patch copies all symbols including local ones if -emit-reloc is given. Fixes https://bugs.llvm.org/show_bug.cgi?id=41385 Differential Revision: https://reviews.llvm.org/D60306 llvm-svn: 357885
* [WebAssembly] Include function in wasm table when used in ↵Sam Clegg2019-04-051-5/+12
| | | | | | | | | | | | R_WASM_TABLE_INDEX_REL_SLEB This should have been part of rL357710 but was overlooked because in our test code the function in question was also used in other relocations that caused it to be added to the table anyway. Differential Revision: https://reviews.llvm.org/D60296 llvm-svn: 357737
* [WebAssembly] Apply data relocations at runtime in shared objectsSam Clegg2019-04-042-4/+25
| | | | | | | | | | | | | See: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md Data section relocations in wasm shared libraries are applied by the library itself at static constructor time. This change adds a new synthetic function that applies relocations to relevant memory locations on startup. Differential Revision: https://reviews.llvm.org/D59278 llvm-svn: 357715
* [COFF] Fix delay import directory iteratorJoseph Tremoulet2019-04-043-0/+236
| | | | | | | | | | | | | | | | | | Summary: Take the Index into account in `getDelayImportTable`, otherwise we always return the entry for the first delay DLL reference. Reviewers: ruiu Reviewed By: ruiu Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60081 llvm-svn: 357697
* [LLD] - Update the test cases after yaml2obj change.George Rimar2019-04-0337-296/+281
| | | | | | | | | https://reviews.llvm.org/D60122 (r357595) changed the symbols description format. This change updates the LLD tests. llvm-svn: 357596
* Re-land "[WebAssembly] Improve invalid relocation error message""Sam Clegg2019-03-291-1/+1
| | | | | | | | | | See https://reviews.llvm.org/D59860 The initial version of this change effected more than just the error message. This version is scoped down to only effect the error itself. llvm-svn: 357328
* [WebAssembly] "atomics" feature requires shared memoryThomas Lively2019-03-292-0/+135
| | | | | | | | | | | | | | | | | | Summary: Makes it a linker error if the "atomics" feature is used but the user does not opt in to shared memory or if "atomics" is disallowed but the user does opt in to shared memory. Also check that an appropriate max memory size is supplied if shared memory is used. Reviewers: sbc100, aheejin Subscribers: dschuff, jgravelle-google, sunfish, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59281 llvm-svn: 357310
* [LLD][COFF] Generate import modules & COFF groups in PDBAlexandre Ganea2019-03-291-6/+149
| | | | | | | | | | | | Generate import modules for each imported DLL, along with its symbol stream. Also create COFF groups in the * Linker * module, one for each PartialSection (input, unmerged sections) Currently COFF groups are disabled for MINGW because it significantly increases PDB sizes. We could enable that later with an option. The overall objective for this change is to support code hot patching tools. Such tools need to know the import libraries used, from the PDB alone. Differential Revision: https://reviews.llvm.org/D54802 llvm-svn: 357308
* Revert "[WebAssembly] Improve invalid relocation error message"Derek Schuff2019-03-291-1/+1
| | | | | | This reverts commit 0805ec5f7b5c80474352531a99e721c30e73e77f. llvm-svn: 357225
* Fixed the lld test using ld-lld command to use ld.lld instead.Rumeet Dhindsa2019-03-281-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D59962 llvm-svn: 357216
* [ELF][ARM] Recommit Redesign of .ARM.exidx handling to use a SyntheticSectionPeter Smith2019-03-289-53/+229
| | | | | | | | | | | | | | | | | | | | | | Recommit r356666 with fixes for buildbot failure, as well as handling for --emit-relocs, which we decide not to emit any relocation sections as the table is already position independent and an offline tool can deduce the relocations. Instead of creating extra Synthetic .ARM.exidx sections to account for gaps in the table, create a single .ARM.exidx SyntheticSection that can derive the contents of the gaps from a sorted list of the executable InputSections. This has the benefit of moving the ARM specific code for SyntheticSections in SHF_LINK_ORDER processing and the table merging code into the ARM specific SyntheticSection. This also makes it easier to create EXIDX_CANTUNWIND table entries for executable InputSections that don't have an associated .ARM.exidx section. Fixes pr40277 Differential Revision: https://reviews.llvm.org/D59216 llvm-svn: 357160
* [WebAssembly] Improve invalid relocation error messageSam Clegg2019-03-281-1/+1
| | | | | | | | This message now matches the equivalent message in the ELF linker. Differential Revision: https://reviews.llvm.org/D59860 llvm-svn: 357143
* [ELF] Dump symbols ordered by profiled guided section layout to file.Rui Ueyama2019-03-272-0/+79
| | | | | | | | | | | | | | | | Patch by Tiancong Wang. In D36351, Call-Chain Clustering (C3) heuristic is implemented with option --call-graph-ordering-file <file>. This patch adds a flag --print-symbol-order=<file> to LLD, and when specified, it prints out the symbols ordered by the heuristics to the file. The symbols printout is helpful to those who want to understand the heuristics and want to reproduce the ordering with --symbol-ordering-file in later pass. Differential Revision: https://reviews.llvm.org/D59311 llvm-svn: 357133
* [LLD] Restore tests that use "-" as outputAndrew Ng2019-03-275-38/+19
| | | | | | | | | | No longer require workarounds for output to "-" (stdout) for Windows. These workarounds were just hiding the actual problem which has been fixed in r357058. Differential Revision: https://reviews.llvm.org/D59824 llvm-svn: 357072
* Revert "[lld] Reapply "Prevent duplicate files in debug line header in dwarf ↵Ali Tamur2019-03-262-7/+9
| | | | | | | | | | | 5."" This reverts commit rL357020 Reason: rL357018, which this commit depend on breaks the test: llvm/test/tools/llvm-objdump/embedded-source.test on some architectures. llvm-svn: 357025
* [WebAssembly] Initial implementation of PIC code generationSam Clegg2019-03-261-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | This change implements lowering of references global symbols in PIC mode. This change implements lowering of global references in PIC mode using a new @GOT reference type. @GOT references can be used with function or data symbol names combined with the get_global instruction. In this case the linker will insert the wasm global that stores the address of the symbol (either in memory for data symbols or in the wasm table for function symbols). For now I'm continuing to use the R_WASM_GLOBAL_INDEX_LEB relocation type for this type of reference which means that this relocation type can refer to either a global or a function or data symbol. We could choose to introduce specific relocation types for GOT entries in the future. See the current dynamic linking proposal: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md Differential Revision: https://reviews.llvm.org/D54647 llvm-svn: 357022
OpenPOWER on IntegriCloud