Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

amontanez (Armando Montanez)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 11 2018, 4:30 PM (272 w, 4 d)

Recent Activity

Jun 5 2019

amontanez added a comment to D61767: [llvm-elfabi] Emit ELF header and string table section.

Initial thoughts from me are the code looks good, but this needs more documentation overall. The approach is clever, but not immediately intuitive so I feel there should be in-code comments to explain it at a high level. Sort of like your descriptions in D55864, but in-code so they are visible to everyone reading it.

Jun 5 2019, 11:10 AM · Restricted Project

Feb 15 2019

amontanez updated the diff for D57975: [ObjectYAML] Let dynamic entries use section names as values.

Rebase, reduced patch contents to only include one feature addition. Rather than using a unified Value field, there's now Value and String fields. This was done because a unified Value field that could accept strings and numbers made it somewhat difficult for obj2yaml to output an appropriately formatted value. This is up for discussion, though, as I'm not sure what I've done is the best solution.

Feb 15 2019, 4:18 PM · Restricted Project

Feb 8 2019

amontanez added a comment to D57691: [yaml2obj][obj2yaml] - Add support for dumping/parsing .dynamic sections..

Oof, my email filters somehow didn't send the discussion here to my inbox. Sorry! I'm fine with this landing as-is, I can just rebase on top of it. I think the only significant deviance from the RFC is future improvements require that DynamicEntry::Val is a StringRef instead of llvm::yaml::Hex64, but I can address that later.

Feb 8 2019, 2:20 PM · Restricted Project
amontanez planned changes to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

See D57975 for the new patch introducing support for writing .dynamic entries. It doesn't include any changes to obj2yaml, or seek to update existing tests. I'm marking this patch as "planned changes" to reduce confusion as to which should be reviewed.

Feb 8 2019, 2:02 PM · Restricted Project
amontanez created D57975: [ObjectYAML] Let dynamic entries use section names as values.
Feb 8 2019, 1:55 PM · Restricted Project

Feb 5 2019

amontanez added a comment to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

This change as-is does a lot, which was what sparked the desire for a RFC. My plan was to trim down this patch once the RFC reached a general consensus so we could have the basic functionality of tag/value pairs and build on that. Further additions (like automatically adding required entries) would be addressed in subsequent changes. If you have anything you'd like to add to the RFC, feel free. I'm fine with you working to land D57691 first if that is high-priority. Otherwise, I can reduce this patch to reflect the general functionality of yours while using some nuances that will prepare for the future features.

Feb 5 2019, 11:24 AM · Restricted Project

Jan 25 2019

amontanez abandoned D53682: [WIP] [llvm-tapi] ELF binary writing initial draft.

This has been redesigned as part of the ELF TextAPI and the llvm-elfabi tool. Those interested should follow the progress of elfabi.

Jan 25 2019, 9:30 AM

Jan 24 2019

amontanez created D57216: [elfabi] Add support for writing dynamic symbols.
Jan 24 2019, 6:30 PM
amontanez committed rL352121: [elfabi] Add support for reading dynamic symbols from binaries.
[elfabi] Add support for reading dynamic symbols from binaries
Jan 24 2019, 2:40 PM
amontanez closed D56031: [elfabi] Add support for reading dynamic symbols from binaries.
Jan 24 2019, 2:40 PM
amontanez updated the diff for D56031: [elfabi] Add support for reading dynamic symbols from binaries.

Fixed a comment that passed 80 character width limit.

Jan 24 2019, 2:36 PM

Jan 23 2019

amontanez planned changes to D55864: [elfabi] Write program headers, .dynamic, .dynstr, and .shstrtab.

Removing from review queues until I look into write commands requested in D55839

Jan 23 2019, 6:19 PM · Restricted Project
amontanez updated the diff for D56031: [elfabi] Add support for reading dynamic symbols from binaries.

Added dummy DT_SYMTAB entries to tests so all tests pass again.

Jan 23 2019, 6:14 PM
amontanez added inline comments to D56031: [elfabi] Add support for reading dynamic symbols from binaries.
Jan 23 2019, 5:26 PM
amontanez updated the diff for D56031: [elfabi] Add support for reading dynamic symbols from binaries.

Changed populateSymbol() to createELFSymbol().

Jan 23 2019, 5:22 PM
amontanez updated the diff for D55864: [elfabi] Write program headers, .dynamic, .dynstr, and .shstrtab.

Cleaned up significantly, added tests, moved from WIP status to ready for review. This patch is very large. I'm open to splitting it up after a brief discussion on how people would prefer I do that.

Jan 23 2019, 12:37 PM · Restricted Project
amontanez updated the diff for D55839: [elfabi] Add support for writing ELF header for binary stubs.

Updated tests.

Jan 23 2019, 9:48 AM · Restricted Project

Jan 22 2019

amontanez updated the diff for D55864: [elfabi] Write program headers, .dynamic, .dynstr, and .shstrtab.

Rebase, split out bigger functions to use helper functions, add a simple test.

Jan 22 2019, 6:40 PM · Restricted Project
amontanez updated the diff for D56031: [elfabi] Add support for reading dynamic symbols from binaries.

Rebase on license changes, fix behavior for edge case when a .gnu.hash section has no buckets.

Jan 22 2019, 2:37 PM
amontanez added inline comments to D56031: [elfabi] Add support for reading dynamic symbols from binaries.
Jan 22 2019, 9:44 AM
amontanez updated the diff for D55839: [elfabi] Add support for writing ELF header for binary stubs.

Comments addressed.

Jan 22 2019, 9:42 AM · Restricted Project

Jan 18 2019

amontanez updated the diff for D56031: [elfabi] Add support for reading dynamic symbols from binaries.

Addressed most of your comments, but I've left the ELF/SYSV hash table in since it amounts to 12 additional lines for now. I can pull it out later if that's really needed. I feel it's relevant and small enough to leave in.

Jan 18 2019, 5:19 PM
amontanez committed rL351592: [elfabi] Add support for reading DT_NEEDED from binaries.
[elfabi] Add support for reading DT_NEEDED from binaries
Jan 18 2019, 1:00 PM
amontanez closed D55852: [elfabi] Add support for reading DT_NEEDED from binaries.
Jan 18 2019, 1:00 PM
amontanez updated the diff for D55839: [elfabi] Add support for writing ELF header for binary stubs.

This should address most of the comments. All functions except for the single writeBinaryStub() have become static functions, and the class has been removed. I'll be updating D55864 to match these changes as soon as possible.

Jan 18 2019, 12:50 PM · Restricted Project
amontanez updated the diff for D56031: [elfabi] Add support for reading dynamic symbols from binaries.

Now uses DT_HASH and DT_GNU_HASH to determine the size of .dynsym. A number of tests still need to be updated as this change requires that a DT_SYMTAB entry exists in the .dynamic section (which many tests are missing).

Jan 18 2019, 10:26 AM

Jan 17 2019

amontanez added a comment to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

There were quite a few tests that required the .dynamic section in D55629. D55852 tests also have a number of .dynamic entries as well. Without the ability to write .dynamic entries in yaml2obj, these will continue to contain a good portion of hexidecimal section contents with annotations. This addition to yaml2obj is going to be rather low-priority for me, but I feel it's the best way to make llvm-elfabi tests more legible. It also will make creation of new tests significantly easier.

Jan 17 2019, 1:58 PM · Restricted Project

Jan 16 2019

amontanez added reviewers for D55852: [elfabi] Add support for reading DT_NEEDED from binaries: phosek, mcgrathr, jhenderson.
Jan 16 2019, 10:17 AM
amontanez updated the diff for D55852: [elfabi] Add support for reading DT_NEEDED from binaries.

Rebase, update error message for DT_NEEDED entries that are outside the string table, and add another test.

Jan 16 2019, 10:17 AM
amontanez committed rL351361: [elfabi] Add support for reading DT_SONAME from binaries.
[elfabi] Add support for reading DT_SONAME from binaries
Jan 16 2019, 9:52 AM
amontanez closed D55629: [elfabi] Add support for reading DT_SONAME from binaries.
Jan 16 2019, 9:52 AM

Jan 15 2019

amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.

using reinterpret_cast now. Since it looks like it might take a bit of time to land support for dynamic entries in yaml2obj, do you feel it would be fine to land this patch now and update the tests later?

Jan 15 2019, 11:37 AM

Jan 14 2019

amontanez updated the summary of D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.
Jan 14 2019, 5:12 PM · Restricted Project
amontanez updated the diff for D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

Quick changes to address some of Rui's comments, and introduced support for the older raw "Content" tag so tools/llvm-objdump/private-headers-no-dynamic-segment.test doesn't fail anymore.

Jan 14 2019, 5:12 PM · Restricted Project
amontanez added a comment to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

The goal of this change is to introduce a new type of YAML section that allows the population of .dynamic entries by providing a list of tag and value pairs. These entries are interpreted (and potentially validated) before being written to the .dynamic section.

Jan 14 2019, 4:56 PM · Restricted Project
amontanez added inline comments to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.
Jan 14 2019, 2:40 PM · Restricted Project
amontanez added inline comments to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.
Jan 14 2019, 12:01 PM · Restricted Project
amontanez updated the diff for D55852: [elfabi] Add support for reading DT_NEEDED from binaries.

Rebase again.

Jan 14 2019, 11:34 AM
amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.

Small change from (const char *)*DynStrPtr to (const char *)DynStrPtr.get() for clarity.

Jan 14 2019, 10:45 AM
amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.

Replaced addrAsOffset() with ELFFile<ELFT>::toMappedAddr(), updated tests.

Jan 14 2019, 10:39 AM
amontanez added inline comments to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.
Jan 14 2019, 9:30 AM · Restricted Project

Jan 11 2019

amontanez updated the diff for D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

I changed a lot and included the majority of what was originally going to be in a second follow-up patch.

Jan 11 2019, 6:44 PM · Restricted Project

Jan 10 2019

amontanez added a comment to D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.

I was thinking the same while writing this. The only argument I have is that this allows obj2yaml to print values in decimal and pointers in hexadecimal. That's a rather weak argument though. I'm totally fine with simplifying it down to just using d_val.

Jan 10 2019, 5:19 PM · Restricted Project
amontanez updated the diff for D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.
Jan 10 2019, 5:14 PM · Restricted Project
amontanez created D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries.
Jan 10 2019, 4:56 PM · Restricted Project

Jan 7 2019

amontanez added inline comments to D55629: [elfabi] Add support for reading DT_SONAME from binaries.
Jan 7 2019, 5:02 PM
amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.

Cleaned up tests and made them significantly more consistent.

Jan 7 2019, 4:50 PM
amontanez closed D55619: [elfabi] Add option to manually specify file read format.

Closed in rL350545

Jan 7 2019, 9:39 AM
amontanez committed rL350545: [elfabi] Add option to manually specify file read format.
[elfabi] Add option to manually specify file read format
Jan 7 2019, 9:36 AM

Jan 4 2019

amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.

The offset of .dynstr is now calculated using the DT_STRTAB address along with the program headers.

Jan 4 2019, 12:56 PM

Jan 3 2019

amontanez added a reviewer for D55629: [elfabi] Add support for reading DT_SONAME from binaries: jhenderson.
Jan 3 2019, 4:32 PM
amontanez updated the diff for D55852: [elfabi] Add support for reading DT_NEEDED from binaries.

Rebase on D55629 change that addresses strings that overrun string table bounds.

Jan 3 2019, 4:29 PM
amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.

Addressed feedback in D55852: strings that overrun the bounds of a string table (due to absent null terminator or incorrect string table size) are reported as errors in terminatedSubstr().

Jan 3 2019, 4:10 PM
amontanez committed rL350341: [elfabi] Introduce tool for ELF TextAPI.
[elfabi] Introduce tool for ELF TextAPI
Jan 3 2019, 10:36 AM
amontanez closed D55352: [elfabi] Introduce tool for ELF TextAPI.
Jan 3 2019, 10:36 AM
amontanez accepted D56216: Rename TapiTests to TextAPITests.

LGTM.

Jan 3 2019, 10:00 AM

Dec 21 2018

amontanez created D56031: [elfabi] Add support for reading dynamic symbols from binaries.
Dec 21 2018, 3:07 PM
amontanez committed rL349963: [TextAPI][elfabi] Fix failing tests from D56020.
[TextAPI][elfabi] Fix failing tests from D56020
Dec 21 2018, 1:47 PM
amontanez committed rL349950: [TextAPI][elfabi] Fix YAML support for weak symbols.
[TextAPI][elfabi] Fix YAML support for weak symbols
Dec 21 2018, 12:50 PM
amontanez closed D56020: [TextAPI][elfabi] Fix YAML support for weak symbols.
Dec 21 2018, 12:49 PM
amontanez created D56020: [TextAPI][elfabi] Fix YAML support for weak symbols.
Dec 21 2018, 12:20 PM
amontanez updated the diff for D55852: [elfabi] Add support for reading DT_NEEDED from binaries.

Rebase and use terminatedSubstr() to fetch DT_NEEDED strings from .dynstr string table.

Dec 21 2018, 10:39 AM
amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.
  • Mandatory DynamicEntries members are now uint64_t instead of Optional<uint64_t>, now include more checks for correctness.
    • Bound checking when creating SoName string from .dynstr table.
Dec 21 2018, 10:26 AM

Dec 20 2018

amontanez updated the diff for D55852: [elfabi] Add support for reading DT_NEEDED from binaries.

Rebase onto previous patch resolves most of the comments for this patch.

Dec 20 2018, 11:36 AM
amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.

Small change to make functions static.

Dec 20 2018, 11:31 AM
amontanez added inline comments to D55629: [elfabi] Add support for reading DT_SONAME from binaries.
Dec 20 2018, 10:59 AM
amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.
  • There is no longer one function to populate each ELFStub member.
    • The .dynamic table is only scanned once.
Dec 20 2018, 10:49 AM

Dec 19 2018

amontanez added inline comments to D55619: [elfabi] Add option to manually specify file read format.
Dec 19 2018, 4:19 PM
amontanez updated the diff for D55619: [elfabi] Add option to manually specify file read format.
  • Rebase on changes to parent patch.
  • Fix test formatting.
  • Input format flags are now lowercase only.
Dec 19 2018, 4:10 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.
  • Fixed test formatting.
Dec 19 2018, 3:20 PM
amontanez added inline comments to D55352: [elfabi] Introduce tool for ELF TextAPI.
Dec 19 2018, 2:50 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.

Quick bugfix in ErrorCollector::makeError() and change to make the function more concise.

Dec 19 2018, 2:33 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.
  • Populating ELFStub.Arch is now inline.
    • ErrorCollector.log() now prefixes each error with "error: " in red.
    • ErrorCollector.makeError() now uses joinErrors() in lieu of a specialized Error type (marked as TODO) that gives more control over how to handle each error.
    • addError() now takes a r-value reference Error.
Dec 19 2018, 2:20 PM

Dec 18 2018

amontanez created D55864: [elfabi] Write program headers, .dynamic, .dynstr, and .shstrtab.
Dec 18 2018, 4:30 PM · Restricted Project
amontanez created D55852: [elfabi] Add support for reading DT_NEEDED from binaries.
Dec 18 2018, 1:55 PM
amontanez created D55839: [elfabi] Add support for writing ELF header for binary stubs.
Dec 18 2018, 10:28 AM · Restricted Project

Dec 13 2018

amontanez added a comment to D55352: [elfabi] Introduce tool for ELF TextAPI.

Hopefully this clarifies the direction on some things brought up. I didn't explicitly mention that everything outside llvm-elfabi.cpp is designed as if it were part of a library. Let me know if this resolves some concerns you had or brings up new ones. I really appreciate your insight, push back again on anything you still feels needs to be changed and I'll look into it again.

Dec 13 2018, 3:11 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.

Forgot to include a few changes for a couple files.

Dec 13 2018, 1:19 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.
  • Addressed several areas of feedback.
Dec 13 2018, 1:14 PM

Dec 12 2018

amontanez updated the diff for D55629: [elfabi] Add support for reading DT_SONAME from binaries.

Small code formatting fix.

Dec 12 2018, 5:05 PM
amontanez created D55629: [elfabi] Add support for reading DT_SONAME from binaries.
Dec 12 2018, 4:46 PM
amontanez updated the diff for D55619: [elfabi] Add option to manually specify file read format.

Small change to read-tbe-as-elf.test to make it easier to debug test failure.

Dec 12 2018, 4:11 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.

Small change to binary-read-arch.test to make it easier to debug test failure.

Dec 12 2018, 4:03 PM
amontanez created D55619: [elfabi] Add option to manually specify file read format.
Dec 12 2018, 2:17 PM

Dec 11 2018

amontanez added inline comments to D55352: [elfabi] Introduce tool for ELF TextAPI.
Dec 11 2018, 6:46 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.
  • ErrorCollector now clears errors when makeError() is called.
Dec 11 2018, 6:38 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.

Added:

  • ErrorCollector for collectively handling multiple related errors.
Dec 11 2018, 3:37 PM

Dec 10 2018

amontanez committed rL348817: [TextAPI][elfabi] Make SoName optional.
[TextAPI][elfabi] Make SoName optional
Dec 10 2018, 5:03 PM
amontanez closed D55533: [TextAPI][elfabi] Make SoName optional.
Dec 10 2018, 5:03 PM
amontanez updated the summary of D55533: [TextAPI][elfabi] Make SoName optional.
Dec 10 2018, 4:35 PM
amontanez created D55533: [TextAPI][elfabi] Make SoName optional.
Dec 10 2018, 4:30 PM
amontanez added inline comments to D55352: [elfabi] Introduce tool for ELF TextAPI.
Dec 10 2018, 1:03 PM
amontanez updated the diff for D55352: [elfabi] Introduce tool for ELF TextAPI.
  • Classes removed, functions are all standalone with no state.
    • Now using Expected<std::unique_ptr<ELFStub>> for everything that would previously return a std::unique_ptr<ELFStub>.
    • Added tests to check for proper failure output.
Dec 10 2018, 12:33 PM

Dec 9 2018

amontanez committed rL348736: [TextAPI][elfabi] Fix build by adding std::move() to r348735.
[TextAPI][elfabi] Fix build by adding std::move() to r348735
Dec 9 2018, 7:09 PM
amontanez committed rL348735: [TextAPI][elfabi] Make TBE handlers functions that return Errors.
[TextAPI][elfabi] Make TBE handlers functions that return Errors
Dec 9 2018, 6:40 PM
amontanez closed D55450: [TextAPI][elfabi] Make TBE handlers functions that return Errors.
Dec 9 2018, 6:40 PM

Dec 7 2018

amontanez created D55450: [TextAPI][elfabi] Make TBE handlers functions that return Errors.
Dec 7 2018, 12:11 PM
amontanez accepted D55381: [llvm-tapi] Don't try to override SequenceTraits for std::string.
Dec 7 2018, 11:05 AM
amontanez added a comment to D55381: [llvm-tapi] Don't try to override SequenceTraits for std::string.

No further comments, LGTM

Dec 7 2018, 11:04 AM
amontanez added a comment to D55381: [llvm-tapi] Don't try to override SequenceTraits for std::string.

I can open a new patch that does exactly this since this patch is marked as abandoned. I haven't checked to see if phabricator supports re-opening an abandoned change.

Dec 7 2018, 8:30 AM