Page MenuHomePhabricator

gkm (Greg McGary)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 13 2020, 11:31 AM (65 w, 6 d)

Recent Activity

Today

gkm committed rGf27e4548fc42: [lld-macho] Implement ICF (authored by gkm).
[lld-macho] Implement ICF
Thu, Jun 17, 10:09 AM
gkm closed D103292: [lld-macho] Implement ICF.
Thu, Jun 17, 10:09 AM · Restricted Project, Restricted Project
gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • fix clang-tidy complaint
Thu, Jun 17, 7:24 AM · Restricted Project, Restricted Project

Yesterday

gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • revise according to review feedback
  • add -no_deduplicate option as synonym for -icf none
  • handle isa<DylibSymbol> in equalsVariable()
  • add test for no fold when dylib symbol references differ
Wed, Jun 16, 11:27 AM · Restricted Project, Restricted Project

Fri, Jun 11

gkm added inline comments to D103292: [lld-macho] Implement ICF.
Fri, Jun 11, 1:33 PM · Restricted Project, Restricted Project
gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • revise according to review feedback
  • add some TODOs to lld/test/MachO/icf.s
Fri, Jun 11, 1:22 PM · Restricted Project, Restricted Project
gkm added a comment to D104084: [lld-macho] Add options -(no_)keep_dwarf_unwind.

The intelligent approach isn't _that_ hard, is it? It's < 200 lines in ld64 I think. ld64-linked Chromium Framework leaves some __eh_frame around, so I think removing the whole section generally probably doesn't work.

Fri, Jun 11, 10:18 AM · Restricted Project, Restricted Project
gkm updated the summary of D104084: [lld-macho] Add options -(no_)keep_dwarf_unwind.
Fri, Jun 11, 10:14 AM · Restricted Project, Restricted Project

Thu, Jun 10

gkm requested review of D104084: [lld-macho] Add options -(no_)keep_dwarf_unwind.
Thu, Jun 10, 6:18 PM · Restricted Project, Restricted Project

Wed, Jun 9

gkm updated the summary of D103292: [lld-macho] Implement ICF.
Wed, Jun 9, 9:12 PM · Restricted Project, Restricted Project
gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • move ICF code into new files ICF.h and ICF.cpp
  • In InputSection, drop Defined *defined in favor of InputSection *replacement
  • remove expensive ICF debug logging
Wed, Jun 9, 7:32 PM · Restricted Project, Restricted Project
gkm added a comment to D103292: [lld-macho] Implement ICF.

Yes, that's the place it's really used. Does that use justify the .75% overhead? The alternative is making an isec-to-defined map when isec->icfEquivalenceClass & (1ull << 63) .

Do the other LLD backends deal with a similar problem, or is this unique to us/Mach-O's format?

Wed, Jun 9, 12:17 PM · Restricted Project, Restricted Project
gkm added a comment to D103292: [lld-macho] Implement ICF.
Wed, Jun 9, 11:38 AM · Restricted Project, Restricted Project
gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • Relocate things from ConcatOutputSection into new class ICF
Wed, Jun 9, 10:30 AM · Restricted Project, Restricted Project
gkm added a comment to D103292: [lld-macho] Implement ICF.

Could you point out the line where it's used in equalsVariable? I'm not sure I see it...

Wed, Jun 9, 9:12 AM · Restricted Project, Restricted Project

Tue, Jun 8

gkm added a comment to D103292: [lld-macho] Implement ICF.

Haven't dug into the details yet, but a few high-level thoughts:

  • The logging code is fairly extensive. Is it really necessary to commit it? If we are leaving it in, could we perhaps cut out InputSection::defined and symbolicate addresses by doing a linear/binary search for the matching symbol?
Tue, Jun 8, 8:40 PM · Restricted Project, Restricted Project
gkm accepted D103113: [lld-macho] Deduplicate fixed-width literals.

This was very pleasant to read & review!

Tue, Jun 8, 5:01 PM · Restricted Project, Restricted Project
gkm updated the summary of D103292: [lld-macho] Implement ICF.
Tue, Jun 8, 4:32 PM · Restricted Project, Restricted Project
gkm updated the summary of D103292: [lld-macho] Implement ICF.
Tue, Jun 8, 2:20 PM · Restricted Project, Restricted Project
gkm added a comment to D103292: [lld-macho] Implement ICF.
  • The logging code is fairly extensive. Is it really necessary to commit it? If we are leaving it in, could we perhaps cut out InputSection::defined and symbolicate addresses by doing a linear/binary search for the matching symbol?

I can remove the logging and retain it as a patch if/when needed.

  • Relatedly: can we have a perf benchmark between LLD-before-this-diff and LLD-with-this-diff-and-ICF-none? I'm wondering if the increased size of the InputSection will cost us.

Yes.

  • "Folding cannot occur across output-section boundaries, therefore ConcatOutputSection is the natural place to run ICF." -- is this not the case for ELF and COFF? Personally I would prefer keeping "core data types" like ConcatOutputSection as simple as possible, as well as to mirror the ELF/COFF ports more closely.

ELF & COFF also fold only within output sections, but the segregation algorithm runs on all input sections in one batch, so output-section boundaries are enforced explicitly during segregation. Output-section boundaries need not be checked for MachO, because we have already sorted all input sections into ConcatOutputSections. Perhaps I should just remove the comment because it is a minor point and might serve only to mislead.

Tue, Jun 8, 9:48 AM · Restricted Project, Restricted Project

Mon, Jun 7

gkm accepted D102964: [lld-macho] Implement cstring deduplication.

LGTM

Mon, Jun 7, 3:34 PM · Restricted Project, Restricted Project

Sat, Jun 5

gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • Resolve more FIXMEs
  • Update & expand comments
Sat, Jun 5, 2:21 PM · Restricted Project, Restricted Project

Thu, Jun 3

gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • resolved some FIXMEs, updated others
  • integrated with new -dead_strip changes
Thu, Jun 3, 1:18 PM · Restricted Project, Restricted Project
gkm abandoned D103639: * resolved some FIXMEs, updated others * integrated with new `-dead_strip` changes.
Thu, Jun 3, 1:06 PM · Restricted Project, Restricted Project
gkm requested review of D103639: * resolved some FIXMEs, updated others * integrated with new `-dead_strip` changes.
Thu, Jun 3, 11:35 AM · Restricted Project, Restricted Project

Wed, Jun 2

gkm updated the summary of D103292: [lld-macho] Implement ICF.
Wed, Jun 2, 11:01 AM · Restricted Project, Restricted Project
gkm updated the summary of D103292: [lld-macho] Implement ICF.
Wed, Jun 2, 8:47 AM · Restricted Project, Restricted Project

Tue, Jun 1

gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • add FIXME comments
  • add log() monitoring of fold rejections
  • segregate equivalence classes on a dedicated vector
  • break-out Writer::foldIdenticalSections() from Writer::createOutputSections()
Tue, Jun 1, 9:26 AM · Restricted Project, Restricted Project

Sat, May 29

gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • new test cases
Sat, May 29, 10:07 PM · Restricted Project, Restricted Project

Thu, May 27

gkm updated the diff for D103292: [lld-macho] Implement ICF.
  • fix build break
  • fix clang-tidy complaint
  • remove obsolete #if 0
Thu, May 27, 7:39 PM · Restricted Project, Restricted Project
gkm updated the summary of D103292: [lld-macho] Implement ICF.
Thu, May 27, 4:07 PM · Restricted Project, Restricted Project
gkm planned changes to D103292: [lld-macho] Implement ICF.
Thu, May 27, 4:03 PM · Restricted Project, Restricted Project
gkm requested review of D103292: [lld-macho] Implement ICF.
Thu, May 27, 4:02 PM · Restricted Project, Restricted Project

Mon, May 24

gkm added inline comments to D102971: [lld-macho][nfc] Rename MergedOutputSection to ConcatOutputSection.
Mon, May 24, 7:55 AM · Restricted Project, Restricted Project

Sat, May 22

gkm added a comment to D102964: [lld-macho] Implement cstring deduplication.
Sat, May 22, 3:21 PM · Restricted Project, Restricted Project

May 12 2021

gkm committed rG93c8559baf55: [lld-macho] Implement branch-range-extension thunks (authored by gkm).
[lld-macho] Implement branch-range-extension thunks
May 12 2021, 9:46 AM
gkm closed D100818: [lld-macho] Implement branch-range-extension thunks.
May 12 2021, 9:46 AM · Restricted Project, Restricted Project
gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • final revisions according to review feedback
May 12 2021, 9:45 AM · Restricted Project, Restricted Project
gkm updated the summary of D100818: [lld-macho] Implement branch-range-extension thunks.
May 12 2021, 9:42 AM · Restricted Project, Restricted Project
gkm committed rG5a439015393e: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly (authored by gkm).
[llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly
May 12 2021, 6:39 AM
gkm closed D101786: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly.
May 12 2021, 6:39 AM · Restricted Project
gkm updated the diff for D101786: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly.
  • update title & summary
May 12 2021, 6:38 AM · Restricted Project

May 11 2021

gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • backout a few gratuitious changes
  • s/target->target->outOfRangeVA/TargetInfo::outOfRangeVA/ plus extra comments
May 11 2021, 9:42 PM · Restricted Project, Restricted Project
gkm added inline comments to D100818: [lld-macho] Implement branch-range-extension thunks.
May 11 2021, 9:28 PM · Restricted Project, Restricted Project
gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • remove call-site memoization overhead from prepareSymbolRelocation() to avoid penalizing programs that don't need thunks. Do that work in MergedOutputSection::needsThunks(), only after we have determined that we need thunks.
May 11 2021, 9:21 PM · Restricted Project, Restricted Project
gkm updated the diff for D101786: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly.
  • trim a few more load commands from the test YAML
May 11 2021, 5:50 PM · Restricted Project
gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • revise according to review feedback
May 11 2021, 4:37 PM · Restricted Project, Restricted Project
gkm updated the diff for D101786: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly.
  • revise according to review feedback
May 11 2021, 4:36 PM · Restricted Project
gkm added a comment to D100818: [lld-macho] Implement branch-range-extension thunks.

JFYI, if you click on the M / N Comments button in the top-right-hand corner, it will take you to the un-done comments :)

May 11 2021, 3:34 PM · Restricted Project, Restricted Project
gkm added inline comments to D100818: [lld-macho] Implement branch-range-extension thunks.
May 11 2021, 3:33 PM · Restricted Project, Restricted Project
gkm added inline comments to D101786: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly.
May 11 2021, 2:38 PM · Restricted Project
gkm added inline comments to D101786: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly.
May 11 2021, 1:44 PM · Restricted Project
gkm added a comment to D102126: [lld-macho] place __TEXT,__stubs before __TEXT,__text.
May 11 2021, 10:18 AM · Restricted Project, Restricted Project

May 10 2021

gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • disable test for windows, which has no shell for loops
May 10 2021, 5:05 PM · Restricted Project, Restricted Project
gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • add a call (__nan) through a dylib stub to the test case
May 10 2021, 12:18 PM · Restricted Project, Restricted Project
gkm added a comment to D100818: [lld-macho] Implement branch-range-extension thunks.

seems like you're addressing the comments incrementally, lmk when this is ready for review

May 10 2021, 11:14 AM · Restricted Project, Restricted Project
gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • handle OPT_verbose via log()
  • Drop new Reloc member isCallSite, and use existing RelocAttrBits::BRANCH
  • add test case
May 10 2021, 11:13 AM · Restricted Project, Restricted Project

May 9 2021

gkm added a comment to D102137: [lld-macho] Don't reference entry symbol for non-executables.

LGTM!

May 9 2021, 3:59 PM · Restricted Project, Restricted Project
gkm planned changes to D102126: [lld-macho] place __TEXT,__stubs before __TEXT,__text.
May 9 2021, 3:31 PM · Restricted Project, Restricted Project
gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • revise according to review feedback
May 9 2021, 12:14 PM · Restricted Project, Restricted Project
gkm added inline comments to D100818: [lld-macho] Implement branch-range-extension thunks.
May 9 2021, 12:13 PM · Restricted Project, Restricted Project
gkm requested review of D102126: [lld-macho] place __TEXT,__stubs before __TEXT,__text.
May 9 2021, 12:25 AM · Restricted Project, Restricted Project

May 8 2021

gkm updated the diff for D101786: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly.
  • revise according to review feedback
May 8 2021, 6:17 PM · Restricted Project
gkm committed rG4b8962940322: [lld-macho][NFC] Purge stale test-output trees prior to split-file (authored by gkm).
[lld-macho][NFC] Purge stale test-output trees prior to split-file
May 8 2021, 5:37 PM
gkm closed D102112: [lld-macho][NFC] Purge stale test-output trees prior to split-file.
May 8 2021, 5:37 PM · Restricted Project, Restricted Project
gkm requested review of D102112: [lld-macho][NFC] Purge stale test-output trees prior to split-file.
May 8 2021, 11:43 AM · Restricted Project, Restricted Project
gkm committed rG5be8502271ac: [lld-macho] Explicitly undefine literal exported symbols (authored by gkm).
[lld-macho] Explicitly undefine literal exported symbols
May 8 2021, 11:38 AM
gkm closed D102100: [lld-macho] Explicitly undefine literal exported symbols.
May 8 2021, 11:38 AM · Restricted Project, Restricted Project
gkm updated the diff for D102100: [lld-macho] Explicitly undefine literal exported symbols.
  • revise according to review feedback, notably: reorg lld/test/MachO/export-options.s to move all split input files at the end.
May 8 2021, 11:36 AM · Restricted Project, Restricted Project

May 7 2021

gkm requested review of D102100: [lld-macho] Explicitly undefine literal exported symbols.
May 7 2021, 9:37 PM · Restricted Project, Restricted Project
gkm abandoned D102099: [lld-macho] exported symbols can also be lazy.

Just to confirm -- does ld64 also not fetch a symbol from an archive even when it is specified as an -exported_symbol?

May 7 2021, 9:13 PM · Restricted Project, Restricted Project
gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • revise according to review feedback
  • place thunks to reach far-away stubs, both when __stubs precedes __text and when __stubs follows __text
May 7 2021, 6:40 PM · Restricted Project, Restricted Project
gkm updated the diff for D102099: [lld-macho] exported symbols can also be lazy.
  • update test case
May 7 2021, 6:34 PM · Restricted Project, Restricted Project
gkm requested review of D102099: [lld-macho] exported symbols can also be lazy.
May 7 2021, 6:07 PM · Restricted Project, Restricted Project
gkm accepted D102076: [lld/mac] Write every weak symbol only once in the output.

LGTM

May 7 2021, 12:49 PM · Restricted Project, Restricted Project
gkm added inline comments to D100818: [lld-macho] Implement branch-range-extension thunks.
May 7 2021, 10:32 AM · Restricted Project, Restricted Project

May 3 2021

gkm updated the summary of D100818: [lld-macho] Implement branch-range-extension thunks.
May 3 2021, 10:54 PM · Restricted Project, Restricted Project
gkm updated the diff for D100818: [lld-macho] Implement branch-range-extension thunks.
  • Revise according to review feedback
May 3 2021, 10:36 PM · Restricted Project, Restricted Project
gkm added inline comments to D100818: [lld-macho] Implement branch-range-extension thunks.
May 3 2021, 10:26 PM · Restricted Project, Restricted Project
gkm committed rG27b426b0c8ab: [lld-macho] Implement builtin section renaming (authored by gkm).
[lld-macho] Implement builtin section renaming
May 3 2021, 9:47 PM
gkm closed D101395: [lld-macho] Implement builtin section renaming.
May 3 2021, 9:47 PM · Restricted Project, Restricted Project
gkm added inline comments to D101395: [lld-macho] Implement builtin section renaming.
May 3 2021, 5:43 PM · Restricted Project, Restricted Project
gkm added a comment to D100818: [lld-macho] Implement branch-range-extension thunks.

Feel free to ignore me,

May 3 2021, 2:45 PM · Restricted Project, Restricted Project
gkm updated the diff for D101395: [lld-macho] Implement builtin section renaming.
  • Revise according to review feedback
May 3 2021, 2:18 PM · Restricted Project, Restricted Project
gkm requested review of D101786: [llvm-objdump] Exclude __mh_*_header symbols during MachO disassembly.
May 3 2021, 1:55 PM · Restricted Project

Apr 30 2021

gkm accepted D101548: [llvm-readobj] Recognize N_THUMB_DEF as a symbol flag.

LGTM

Apr 30 2021, 9:16 AM · Restricted Project, Restricted Project
gkm accepted D101557: [lld-macho] Initial scaffolding for ARM32 support.

💪🏼

Apr 30 2021, 9:13 AM · Restricted Project, Restricted Project
gkm accepted D101558: [lld-macho] Parse & emit the N_ARM_THUMB_DEF symbol flag.

LGTM ... except for the jarring introduction of an arch-specific bit into arch-independent code. Yet, N_ARM_THUMB_DEF already exists as an arch-dependent bit among the otherwise arch-independent symbol table flags, so I see no way around it.

Apr 30 2021, 9:11 AM · Restricted Project, Restricted Project

Apr 29 2021

gkm published D100818: [lld-macho] Implement branch-range-extension thunks for review.
Apr 29 2021, 9:07 AM · Restricted Project, Restricted Project

Apr 27 2021

gkm added inline comments to D101395: [lld-macho] Implement builtin section renaming.
Apr 27 2021, 7:23 PM · Restricted Project, Restricted Project
gkm updated the diff for D101395: [lld-macho] Implement builtin section renaming.
  • Add a test for error diagnistic when merging sections with mismatched types
Apr 27 2021, 7:22 PM · Restricted Project, Restricted Project
gkm added inline comments to D101395: [lld-macho] Implement builtin section renaming.
Apr 27 2021, 6:03 PM · Restricted Project, Restricted Project
gkm updated the diff for D101395: [lld-macho] Implement builtin section renaming.
  • revise according to review feedback
Apr 27 2021, 5:58 PM · Restricted Project, Restricted Project
gkm committed rG465204d63a71: [lld-macho][NFC] define more strings in section_names:: and segment_names:: (authored by gkm).
[lld-macho][NFC] define more strings in section_names:: and segment_names::
Apr 27 2021, 5:50 PM
gkm closed D101393: [lld-macho][NFC] define more strings in section_names:: and segment_names::.
Apr 27 2021, 5:49 PM · Restricted Project, Restricted Project
gkm added a comment to D101395: [lld-macho] Implement builtin section renaming.

I think we should implement features on an as-needed basis. E.g. we aren't likely to support MH_KEXT_BUNDLE or MH_DYLINKER any time in the near future, so I don't think adding code for them is worthwhile.

Apr 27 2021, 5:07 PM · Restricted Project, Restricted Project
gkm added a comment to D101395: [lld-macho] Implement builtin section renaming.
Apr 27 2021, 4:40 PM · Restricted Project, Restricted Project
gkm updated the diff for D101393: [lld-macho][NFC] define more strings in section_names:: and segment_names::.
  • migrate bugfix in MergedOutputSection::mergeFlags() out of this NFC diff
Apr 27 2021, 2:22 PM · Restricted Project, Restricted Project
gkm added inline comments to D101393: [lld-macho][NFC] define more strings in section_names:: and segment_names::.
Apr 27 2021, 2:11 PM · Restricted Project, Restricted Project
gkm requested review of D101395: [lld-macho] Implement builtin section renaming.
Apr 27 2021, 12:50 PM · Restricted Project, Restricted Project