Page MenuHomePhabricator

mtrent (Michael Trent)
User

Projects

User does not belong to any projects.

User Details

User Since
Dec 5 2017, 3:14 PM (155 w, 4 d)

Recent Activity

Oct 20 2020

mtrent added a comment to D89561: [MC] Adjust StringTableBuilder for linked Mach-O binaries.

@mtrent, do you have the historical context for why ld64 adds a leading space to the string table?

Oct 20 2020, 9:24 PM · Restricted Project

Oct 17 2020

mtrent accepted D89561: [MC] Adjust StringTableBuilder for linked Mach-O binaries.

Looks good to me!

Oct 17 2020, 4:46 PM · Restricted Project

Oct 16 2020

mtrent added inline comments to D89561: [MC] Adjust StringTableBuilder for linked Mach-O binaries.
Oct 16 2020, 11:04 AM · Restricted Project

Oct 12 2020

mtrent resigned from D88468: [llvm-readobj] Don't print out section names for STABS symbols.
Oct 12 2020, 3:17 PM · Restricted Project

May 10 2020

mtrent abandoned D78032: [llvm-objdump] Default to the "apple-latest" mcpu when disassembling arm64 Mach-O binaries.
May 10 2020, 10:27 PM · Restricted Project

May 4 2020

mtrent added inline comments to D79309: [llvm-objdump] -d: delete spaces among raw instruction bytes.
May 4 2020, 10:09 AM · Restricted Project
mtrent added a comment to D79309: [llvm-objdump] -d: delete spaces among raw instruction bytes.

ARM's data detection only works for unstripped binaries. Other architectures often don't even have such markers at all.

May 4 2020, 9:37 AM · Restricted Project

Apr 24 2020

mtrent added a comment to D78775: [MC] Fix quadratic behavior in addPendingLabel.

Thanks for finding this!

Apr 24 2020, 10:48 AM · Restricted Project

Apr 23 2020

mtrent added a comment to D62070: Update llvm-nm -s to use a multi-var option.

It seems that we have some parsing difficulty here:/ I tried to use llvm-nm -s today for --print-armap (GNU/FreeBSD nm) and I noticed that -s is reserved for Mach-O. https://www.unix.com/man-page/osx/1/nm/ says

-s segname sectname
List only those symbols in the section (segname,sectname).

This also appears to be the last use case of cl::multi_val:/ Does -s have a longer option for the SegSect functionality? After all, it has been broken so many years... (the only order which was supported was llvm-nm /bin/ls -s __TEXT __text before this patch).

Apr 23 2020, 4:19 PM · Restricted Project

Apr 14 2020

mtrent updated the diff for D78032: [llvm-objdump] Default to the "apple-latest" mcpu when disassembling arm64 Mach-O binaries.

Add a comment about the purpose of the test.

Apr 14 2020, 4:53 PM · Restricted Project
mtrent added a comment to D78032: [llvm-objdump] Default to the "apple-latest" mcpu when disassembling arm64 Mach-O binaries.

Can you clarify whether the intention is:

  • For MachOObjectFile::getArchTriple, we want to use a conservative arch flag, because it may be used by both producers and consumers. We don't want to impose an arch feature restriction for binaries created by the producers.
  • For llvm-objdump and may be llvm-nm/llvm-size, the read-only consumers, we want to use the latest arch flag so that all features can be decoded correctly.

I don't understand the question?

Is it possible to make the (defaulting mcpu to "apple-latest") decision in a library, instead of in llvm-objdump and other individual tools?

Apr 14 2020, 4:52 PM · Restricted Project

Apr 13 2020

mtrent added a comment to D78032: [llvm-objdump] Default to the "apple-latest" mcpu when disassembling arm64 Mach-O binaries.

Can you clarify whether the intention is:

  • For MachOObjectFile::getArchTriple, we want to use a conservative arch flag, because it may be used by both producers and consumers. We don't want to impose an arch feature restriction for binaries created by the producers.
  • For llvm-objdump and may be llvm-nm/llvm-size, the read-only consumers, we want to use the latest arch flag so that all features can be decoded correctly.
Apr 13 2020, 11:17 AM · Restricted Project
mtrent added a comment to D78032: [llvm-objdump] Default to the "apple-latest" mcpu when disassembling arm64 Mach-O binaries.

In GNU objdump, -m is another option which takes an argument.

-m machine
 --architecture=machine
     Specify the architecture to use when disassembling object files.  This can be useful when disassembling object files which do not
     describe architecture information, such as S-records.  You can list the available architectures with the -i option.

     If the target is an ARM architecture then this switch has an additional effect.  It restricts the disassembly to only those
     instructions supported by the architecture specified by machine.  If it is necessary to use this switch because the input file does not
     contain any architecture information, but it is also desired to disassemble all the instructions use -marm.

Would it be possible to remove the -m alias for --macho?

Apr 13 2020, 11:17 AM · Restricted Project
mtrent created D78032: [llvm-objdump] Default to the "apple-latest" mcpu when disassembling arm64 Mach-O binaries.
Apr 13 2020, 10:11 AM · Restricted Project

Mar 7 2020

mtrent resigned from D62148: [llvm-nm] Omit the symbol table entry at index 0 when --debug-syms is enabled for ELF files.
Mar 7 2020, 12:28 PM

Mar 4 2020

mtrent committed rGdf058699d328: Fix dyld opcode *_ADD_ADDR_IMM_SCALED error detection. (authored by mtrent).
Fix dyld opcode *_ADD_ADDR_IMM_SCALED error detection.
Mar 4 2020, 8:08 PM
mtrent closed D75629: Fix dyld opcode *_ADD_ADDR_IMM_SCALED error detection..
Mar 4 2020, 8:08 PM · Restricted Project
mtrent created D75629: Fix dyld opcode *_ADD_ADDR_IMM_SCALED error detection..
Mar 4 2020, 11:15 AM · Restricted Project

Feb 28 2020

mtrent accepted D75067: [LTO][Legacy] Add new API to query Mach-O CPU (sub)type.
Feb 28 2020, 11:12 AM · Restricted Project

Feb 19 2020

mtrent accepted D74808: [MachO][NFC] Extract all CPU_(SUB_)TYPE logic to libObject.
Feb 19 2020, 1:48 PM · Restricted Project

Feb 3 2020

mtrent committed rG9944ef42696e: Omit "Contents of" headers when -no-leading-headers is specified. (authored by mtrent).
Omit "Contents of" headers when -no-leading-headers is specified.
Feb 3 2020, 1:35 PM
mtrent closed D73574: Omit "Contents of" headers when -no-leading-headers is specified..
Feb 3 2020, 1:34 PM · Restricted Project
mtrent committed rG0ad18bf37b2d: [llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries. (authored by mtrent).
[llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries.
Feb 3 2020, 11:01 AM
mtrent closed D73586: [llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries..
Feb 3 2020, 11:00 AM · Restricted Project

Jan 30 2020

mtrent added inline comments to D73574: Omit "Contents of" headers when -no-leading-headers is specified..
Jan 30 2020, 4:05 PM · Restricted Project

Jan 29 2020

mtrent retitled D73586: [llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries. from [llvm-objdump] Suppress spurious warnings when parsing Mach-O bianries. to [llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries..
Jan 29 2020, 1:03 PM · Restricted Project
mtrent updated the diff for D73574: Omit "Contents of" headers when -no-leading-headers is specified..

Review feedback: Test -no-leading-headers separately from -no-leading-addr.

Jan 29 2020, 11:21 AM · Restricted Project
mtrent updated the diff for D73586: [llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries..

Review feedback: use --implicit-check-not to catch all unexpected warnings.
Remove unnecessary initialization.

Jan 29 2020, 11:12 AM · Restricted Project
mtrent added inline comments to D73574: Omit "Contents of" headers when -no-leading-headers is specified..
Jan 29 2020, 10:16 AM · Restricted Project
mtrent added inline comments to D73586: [llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries..
Jan 29 2020, 10:16 AM · Restricted Project

Jan 28 2020

mtrent created D73586: [llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries..
Jan 28 2020, 2:43 PM · Restricted Project
mtrent created D73574: Omit "Contents of" headers when -no-leading-headers is specified..
Jan 28 2020, 12:35 PM · Restricted Project

Dec 20 2019

mtrent committed rGb4dfa74a5d80: Constrain the macho-stabs test added in f72d001e099 to run on systems… (authored by mtrent).
Constrain the macho-stabs test added in f72d001e099 to run on systems…
Dec 20 2019, 5:44 PM
mtrent closed D71792: Constrain the macho-stabs test added in f72d001e099 to run on systems configured with an x86 backend..
Dec 20 2019, 5:44 PM · Restricted Project
mtrent created D71792: Constrain the macho-stabs test added in f72d001e099 to run on systems configured with an x86 backend..
Dec 20 2019, 5:44 PM · Restricted Project
mtrent committed rGf72d001e0998: llvm-objdump should ignore Mach-O stab symbols for disassembly. (authored by mtrent).
llvm-objdump should ignore Mach-O stab symbols for disassembly.
Dec 20 2019, 3:21 PM
mtrent closed D71394: llvm-objdump should ignore Mach-O stab symbols for disassembly..
Dec 20 2019, 3:21 PM · Restricted Project

Dec 18 2019

mtrent committed rG6f95d33e2b9e: [ MC ] Match labels to existing fragments even when switching sections. (authored by mtrent).
[ MC ] Match labels to existing fragments even when switching sections.
Dec 18 2019, 10:00 AM

Dec 17 2019

mtrent added a comment to rG4272372c571c: [ MC ] Match labels to existing fragments even when switching sections..

I am building a patch that will correct the problem. Feel free to roll back and I'll repush tomorrow.

Dec 17 2019, 5:01 PM
mtrent committed rG4272372c571c: [ MC ] Match labels to existing fragments even when switching sections. (authored by mtrent).
[ MC ] Match labels to existing fragments even when switching sections.
Dec 17 2019, 8:53 AM
mtrent closed D71368: [ MC ] Match labels to existing fragments even when switching sections..
Dec 17 2019, 8:53 AM · Restricted Project

Dec 16 2019

mtrent abandoned D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..
Dec 16 2019, 1:12 PM · Restricted Project
mtrent added a comment to D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

Very good, I will note this is "not to be fixed" and return the request to support.

Dec 16 2019, 1:12 PM · Restricted Project
mtrent added a comment to D71368: [ MC ] Match labels to existing fragments even when switching sections..

pinging reviewers.

Dec 16 2019, 11:21 AM · Restricted Project
mtrent added a comment to D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

Ping.

Dec 16 2019, 11:21 AM · Restricted Project

Dec 13 2019

mtrent updated the diff for D71394: llvm-objdump should ignore Mach-O stab symbols for disassembly..

Attempt to clarify STAB symbol restriction comment.

Dec 13 2019, 11:37 AM · Restricted Project

Dec 12 2019

mtrent added inline comments to D71394: llvm-objdump should ignore Mach-O stab symbols for disassembly..
Dec 12 2019, 6:06 PM · Restricted Project
mtrent updated the diff for D71394: llvm-objdump should ignore Mach-O stab symbols for disassembly..

Move MachO casts out of work loops.

Dec 12 2019, 9:46 AM · Restricted Project
mtrent added inline comments to D71394: llvm-objdump should ignore Mach-O stab symbols for disassembly..
Dec 12 2019, 9:37 AM · Restricted Project
mtrent added inline comments to D71394: llvm-objdump should ignore Mach-O stab symbols for disassembly..
Dec 12 2019, 7:45 AM · Restricted Project

Dec 11 2019

mtrent created D71394: llvm-objdump should ignore Mach-O stab symbols for disassembly..
Dec 11 2019, 11:02 PM · Restricted Project
mtrent created D71368: [ MC ] Match labels to existing fragments even when switching sections..
Dec 11 2019, 10:49 AM · Restricted Project

Dec 9 2019

mtrent added a comment to D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

Do we know what form that fix will take? And does that affect this PR?

Dec 9 2019, 9:56 AM · Restricted Project

Dec 6 2019

mtrent added a comment to D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

Apparently fasm, x64, Linux, (the "flat assembler") as accessible via "tio.run" will accept "l" suffix as alternate form of the r*b registers. Here's a dorky existence proof:

Dec 6 2019, 10:50 AM · Restricted Project

Dec 5 2019

mtrent added a comment to D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

I'm not sure what to do here. I'd like to see at least some other widely used tool supporting this. I worry we'll end up in a situation years from now where other tools try to match clang for what seems to have started as quirk in Intel's documentation nearly 15 years ago.

Dec 5 2019, 3:12 PM · Restricted Project
mtrent updated the diff for D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

Add tests for these alternate registers.

Dec 5 2019, 2:54 PM · Restricted Project
mtrent added a comment to D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

Do you have examples of other tools that accept this? I checked the GNU assembler and it didn't accept r8l

Dec 5 2019, 2:02 PM · Restricted Project
mtrent added a comment to D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

Test case?

Dec 5 2019, 7:42 AM · Restricted Project

Dec 4 2019

mtrent created D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..
Dec 4 2019, 9:32 PM · Restricted Project

Oct 25 2019

mtrent accepted D69419: [llvm-objcopy][MachO] Add support for min os version load commands.
Oct 25 2019, 11:11 AM · Restricted Project

Oct 15 2019

mtrent committed rL374958: add mdtrent.
add mdtrent
Oct 15 2019, 5:17 PM

Sep 27 2019

mtrent accepted D68116: [llvm-lipo] Add support for -arch.
Sep 27 2019, 10:21 AM · Restricted Project

Sep 23 2019

mtrent accepted D67758: [llvm-lipo] Add support for archives.

Logic looks fine. I have some concerns around alignment terminology that I suggest you address before committing.

Sep 23 2019, 12:49 PM · Restricted Project

Sep 20 2019

mtrent committed rG6a234677f491: Can't pass .dSYM directory to llvm-objdump -dsym= (and error message is wrong) (authored by mtrent).
Can't pass .dSYM directory to llvm-objdump -dsym= (and error message is wrong)
Sep 20 2019, 12:15 PM
mtrent committed rL372421: Can't pass .dSYM directory to llvm-objdump -dsym= (and error message is wrong).
Can't pass .dSYM directory to llvm-objdump -dsym= (and error message is wrong)
Sep 20 2019, 12:15 PM
mtrent closed D67780: Can't pass .dSYM directory to llvm-objdump -dsym= (and error message is wrong).
Sep 20 2019, 12:14 PM · Restricted Project
mtrent updated the diff for D67780: Can't pass .dSYM directory to llvm-objdump -dsym= (and error message is wrong).

mechanical comment changes

Sep 20 2019, 10:41 AM · Restricted Project
mtrent updated the diff for D67780: Can't pass .dSYM directory to llvm-objdump -dsym= (and error message is wrong).

Updating to use path::append to build the bundle contents string.

Sep 20 2019, 10:35 AM · Restricted Project

Sep 19 2019

mtrent created D67780: Can't pass .dSYM directory to llvm-objdump -dsym= (and error message is wrong).
Sep 19 2019, 5:42 PM · Restricted Project

Sep 18 2019

mtrent added inline comments to D67700: [Object] Extend MachOUniversalBinary::getObjectForArch.
Sep 18 2019, 11:23 AM · Restricted Project

Aug 6 2019

mtrent added inline comments to D65676: [llvm-lipo] Update llvm-lipo docs for -info -thin -create -replace -segalign flags.
Aug 6 2019, 4:15 PM · Restricted Project

Jul 31 2019

mtrent accepted D65491: [llvm-objdump] Fix jumptable detection when disassembling Mach-O binaries.

LGTM, visual inspection only.

Jul 31 2019, 2:01 PM · Restricted Project

Jul 30 2019

mtrent accepted D65477: [build] add the ability to create a symlink for lipo.
Jul 30 2019, 2:02 PM · Restricted Project

Jul 2 2019

mtrent added a comment to D64102: [llvm-lipo] Implement -create part 1.

@mtrent We have implemented create with the -fat64 flag to specify a fat64binary, similar to cctools lipo.
Do we still need this flag, or can we always create a fat64 binary?
Another option would be to have some sort of auto detection to create a fat64 binary when the offset of a section exceeds 32 bits.

Jul 2 2019, 3:48 PM · Restricted Project

Jun 24 2019

mtrent accepted D63735: [MachOObjectFile]Added Valid Architecture Function.
Jun 24 2019, 3:37 PM · Restricted Project
mtrent accepted D63719: [docs][llvm-readobj] Improve llvm-readobj documentation.
Jun 24 2019, 3:23 PM · Restricted Project
mtrent accepted D63651: [docs][llvm-symbolizer] Improve llvm-symbolizer documentation.

I wonder why the Mach-O specific commands are unlike that of other utilities ... In any case, these changes look fine.

Jun 24 2019, 6:17 AM · Restricted Project

Jun 21 2019

mtrent accepted D63341: [llvm-lipo] Implement -thin.
Jun 21 2019, 12:19 AM · Restricted Project
mtrent added a comment to D63341: [llvm-lipo] Implement -thin.

Note: "llvm-lipo" does not work properly with certain Mach-O executables, such as those built with the -hideARM64 flag.

Fixed most of these issues, but for printing a list of knows architectures I am planning to make a change in a separate diff that returns a list of valid architectures, since I will no longer be modifying llvm-lipo code.

For the MachO executables built with -hideARM64 flag, I filed a bug for MachOUniversalBinary: https://bugs.llvm.org/show_bug.cgi?id=42343.

Jun 21 2019, 12:19 AM · Restricted Project
mtrent added a comment to D63606: [docs][llvm-objdump] Improve llvm-objdump documentation.

BTW, there is a manpage: llvm/docs/llvm-objdump.1. It'd be nice to check if it needs updates as well.

Jun 21 2019, 12:16 AM · Restricted Project
mtrent accepted D63606: [docs][llvm-objdump] Improve llvm-objdump documentation.
Jun 21 2019, 12:16 AM · Restricted Project

Jun 20 2019

mtrent accepted D63327: [docs][llvm-nm] Improve symbol code documentation.
Jun 20 2019, 10:26 AM · Restricted Project

Jun 19 2019

mtrent added a comment to D63341: [llvm-lipo] Implement -thin.

i think that we should not "replicate cctools lipo error messages exactly", ours could be better / more convenient or informative where it makes sense.
But in this particular case (see the comments above) I agree, including the names into the error message would be good!
Regarding exit codes - yes, it's important (for many reasons) to make sure that our exit codes are correct.

Jun 19 2019, 8:38 AM · Restricted Project

Jun 18 2019

mtrent requested changes to D63341: [llvm-lipo] Implement -thin.

Would be nice if "llvm-lipo -thin" printed a reasonable error message before dumping usage. Apple lipo will print "missing argument to -thin option"

Jun 18 2019, 9:13 PM · Restricted Project
mtrent committed rGc2885ded2b1e: Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-used (authored by mtrent).
Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-used
Jun 18 2019, 3:18 PM
mtrent committed rL363746: Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-used.
Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-used
Jun 18 2019, 3:16 PM
mtrent closed D62866: Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-used.
Jun 18 2019, 3:16 PM · Restricted Project

Jun 15 2019

mtrent added a comment to D63341: [llvm-lipo] Implement -thin.

I'll have a look Monday / early next week. Meanwhile, here are some quick thoughts.

Jun 15 2019, 12:47 AM · Restricted Project
mtrent accepted D63340: [llvm-nm] Fix for BZ41711 - Class character for a symbol with undefined binding does not match class assigned by GNU nm.

Respectfully, I am not a good reviewer for ELF-specific file format changes. I assume you added me as a proxy for 'enderby', who touched some of the lines of this routine. Looking at the SVN history I believe Kevin Enderby's involvement was limited to promulgating Lang Hames' "Expected<>" as the preferred error handling idiom in libObject and friends. So, again, respectfully, neither Kevin nor I are what I would consider good, authoritative reviewers for ELF.

Jun 15 2019, 12:30 AM
mtrent added a comment to D63327: [docs][llvm-nm] Improve symbol code documentation.

All this looks reasonable, but my grasp of Mach-O is not as complete as I would like, and I have some questions for you.

Jun 15 2019, 12:12 AM · Restricted Project

Jun 11 2019

mtrent accepted D63142: [llvm-nm] Fix docs and help text for --print-size.
Jun 11 2019, 10:35 AM · Restricted Project

Jun 10 2019

mtrent accepted D63100: [llvm-lipo] Update llvm-lipo docs for -archs flag.

approving this revision in light of my notes inline. I still believe this command guide is going to need an editorial pass once all of the options are in. my main concern for the moment is that the information is accurate and complete.

Jun 10 2019, 10:18 PM · Restricted Project

Jun 7 2019

mtrent accepted D62753: [llvm-lipo] Implement -archs.
Jun 7 2019, 11:46 AM · Restricted Project
mtrent accepted D62706: [llvm-lipo] Add docs for llvm-lipo.

Thanks for making this!

Jun 7 2019, 7:55 AM · Restricted Project

Jun 6 2019

mtrent added a comment to D62706: [llvm-lipo] Add docs for llvm-lipo.

I had trouble getting recommonmark.parser to install on my system, so I hacked at the patch to get the html and groff formatters to run. Should not be relevant to this review.

Jun 6 2019, 3:31 PM · Restricted Project
mtrent added a reviewer for D62812: [llvm] [CodeView] Move Triple::ArchType → CPUType mapping from LLDB: friss.

I am not familiar with lldb or with the DebugView library, so I am pulling in Fred Riss for this review. Thanks!

Jun 6 2019, 2:48 PM · Restricted Project
mtrent resigned from D62812: [llvm] [CodeView] Move Triple::ArchType → CPUType mapping from LLDB.
Jun 6 2019, 2:48 PM · Restricted Project
mtrent requested changes to D62753: [llvm-lipo] Implement -archs.

I did not download or run this code, but I believe it does not correctly divine the Arch flag from a given Mach-O binary. This is straight-forward to fix.

Jun 6 2019, 2:42 PM · Restricted Project
mtrent accepted D62955: [llvm-nm] Additional lit tests for command line options.
Jun 6 2019, 8:14 AM

Jun 4 2019

mtrent updated the diff for D62866: Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-used.

Trim unused space from the macho-dylib.test file.

Jun 4 2019, 10:20 AM · Restricted Project