User Details
- User Since
- Jan 18 2017, 2:49 AM (208 w, 4 d)
Today
LGTM.
Maybe a silly suggestion (and one that would need more discussion on the mailing lists), but why not just change the default version to 5 more widely? How often do people deliberately deviate from the default DWARF version in practice? To me, the proposed change feels like a bit of a hack for what is likely fairly unusual usage, and is only temporary, since likely most toolchains will want to change to DWARF v5 at some point going forward.
Looks fine to me, with the caveat that I don't really know much about the functionality, so others with more knowledge should approve too.
Mostly looks fine. It might be nice if we could avoid putting so much code in the ELF.h header file, but that would require more refactoring, so we probably want to leave that to another patch.
Fri, Jan 15
Thu, Jan 14
Okay, LGTM!
LGTM.
LGTM, with nit.
Looks good.
Is it important that the .dynsym is used directly when .hash/.gnu.hash is available? At the moment, your test doesn't really show whether it is used or whether you go straight to the dynamic tags for details, I believe - to do that, you'd need to have one given bogus values for the size, and show that this is not sued. Additionally, you have no testing for your error messages, nor do you have testing that shows that the .gnu.hash is used above the .hash section.
I wonder whether the issue could be better solved by adding something (probably output section sizes as @grimar suggests) to the verbose output? That would allow us to keep the error message more concise, whilst still providing a developer the ability to answer the question of "where does the data go?"
Wed, Jan 13
That's a good point about the address/offset comment. I'm happy with the other idea then. @MaskRay, do you have any thoughts?
LGTM.
Tue, Jan 12
LGTM.
LGTM.
LGTM.
LGTM.
Mon, Jan 11
Fri, Jan 8
I've not reviewed the testing yet, but my immediate thought is that there needs to be a lot more, handling all the different code paths.
The testing for this is going to be somewhat similar to various llvm-readobj examples, which use yaml2obj to generate an ELF object with the required properties. For example, llvm\test\tools\llvm-readobj\ELF\dyn-symbols-size-from-hash-table.test contains testing for the llvm-readobj handling of dynamic symbols when there are no section headers. There are actually further improvements that can be made beyond that. For example, yaml2obj has recently gained the ability to not emit the section header table, rather than needing to use llvm-strip to remove it. See llvm\test\tools\yaml2obj\ELF\section-headers.yaml for an example.
Thu, Jan 7
LGTM.
Personally, I think the new behaviour you're adding makes more sense. The old behaviour could get particularly confusing, I imagine, when matching literal tabs/spaces (e.g. due to --strict-whitespace) etc if the marker moves on later than expected. LGTM, but I think it would be good to get one or two others to give their input.
Could you give a step-by-step example of how you might use the information you want to emit? That will help us ensure that any proposals satisfy the requirements (or possibly to suggest an alternative).
Wed, Jan 6
If this brings us closer to GNU behaviour, that's fine, but I do find it weird that a build system would be doing anything involving sudo to run llvm-objcopy/llvm-strip.
Phabricator is still saying there are unit tests failing. Are these up-to-date reports, or is Phabricator stale?
I agree with @MaskRay: does the map file solve the problem for you?
Tue, Jan 5
LGTM.
LGTM!
Seems to me like you should have a dedicate yaml2obj test that shows the sh_entsize can be set for group sections?
LGTM!
The original split of the two styles came in D14128, by @khemant. I can't see any explanation in that review for taking the route of using a separate style class as opposed to simply doing what you're doing now. Possibly it was just easier to retrofit it in that way. The style/dumper split would make sense, if the styles were shared between the different dumper kinds, but they aren't, and I suspect the dumping functionality for other tools may be too divergent for them to be easily reusable.
Could you explain why this patch fixes the ARM_EXIDX sh_entsize specifically? I don't see anything immediately that would only fix that section (and not other sections).
Mon, Jan 4
If there's a case where this is useful, I definitely support it. More generally, we may want to be able to do the same with program header table placement. I don't know if we have a use-case for that yet, but it's probably worth keeping it in mind as we design this. BeforeSecData is therefore a little bit ambiguous here. For example, between the ELF header and program header table is also "before" the section data. Maybe the key words should be AfterEhdr, AfterPhdrs, AfterSections (or possibly AtEOF for the last one). We could probably not have one of AfterEhdr or AfterPhdrs for now. Longer-term, I could imagine it might be useful to allow arbitrary offsets for the section header table, so we should consider this in our design too.
Sorry for the delay in responding. I and I suspect others who were involved on this have been off over the Christmas period.
Dec 18 2020
LGTM. Please wait for @grimar.
Dec 17 2020
What others said - there are six cases we should care about:
- Section headers are stripped and the ELF has no hash/gnu_hash dynamic tag - this can be treated as an error, I think since the ELF gABI requires a hash table.
- Section headers are stripped, but there is a DT_HASH
- Section headers are stripped, but there is a DT_GNU_HASH
- Section headers present but there is no .hash or .gnu.hash section - this might be treated as an error, I think since the ELF gABI requires a hash table.
- Section headers present with .hash section
- Section headers present with .gnu.hash section
FYI, my last day working this year is tomorrow. I won't be certain to be able to review anything now until the New Year.
LGTM, with nit.
Mostly looks fine, although there's a unit test failure, so not formally LGTMing. As I think I mentioned earlier, I'm not really familiar with the functional aspects of this change, so don't rely on me alone anyway. Tomorrow will be my last day in the office for over two weeks, so feel free to land if you think others have reviewed sufficiently after the remaining test fix.
Dec 16 2020
LGTM, but I wouldn't mind @psmith or someone else with more AArch64 knowledge confirming the calculation is correct.
Given that I've gone cold on this change and need to go through it again properly, and the number of other reviews that are on my plate, in addition to higher priority internal work I need to do before the Christmas break (my last day is Friday), I doubt I'll get a chance to look at this until some time in the New Year. Sorry! If people feel it's important to land sooner than that, please don't let my lack of review block this (I can always do post-commit reviews if needed).
LGTM, with @MaskRay's suggestion. We can work on bubbling up the Error/Expected in due course to get rid of the report_fatal_error calls.
One test suggestion. Otherwise, this looks fine.
Looks good, with one possible set of suggestions.
LGTM.
Sorry, this somehow slipped off my radar, and I've run out of time to do any further significant reviewing today. I've skimmed it briefly, and the general approach looks fine. I'd like ideally to find a way to avoid needing to pass both a pointer and size around for the shndx table, even if it's just to wrap it in a new class, or change to Optional<ArrayRef<...>> or something. If you'd like me to take a more detailed look tomorrow, I can certainly do so.
Dec 15 2020
Sorry, this somehow slipped off my radar, and I've run out of time to do any further significant reviewing today. I've skimmed it briefly, and the general approach looks fine. I'd like ideally to find a way to avoid needing to pass both a pointer and size around for the shndx table, even if it's just to wrap it in a new class, or change to Optional<ArrayRef<...>> or something. If you'd like me to take a more detailed look tomorrow, I can certainly do so.
Looks good to me aside from @grimar's comment.
Looks fine aside from the two outstanding comments re. error messages.
Looks like there are plenty of failing tests still?
Does this change impact reading a dynamic symbol table for an object with no section header table? In such a case, the size is derived from the hash table, so I imagine it'll work the same, but ideally it should be tested.
Dec 14 2020
Obviously, this looks good to me, since this was my original suggestion, but it's probably best for @MaskRay or others to agree.
We've just run into an unexpected side-effect of this change, when this got merged into our downstream branch. We have a number of new ET_* values in the OS-specific range. In our downstream branch, we've added new entries to ElfObjectFileType so that these values are printed nicely as Type: OurCustomType. However, with this change, this has changed to Type: OS Specific: (OurCustomType) which isn't ideal. We can probably live with it, but I wonder if a small refactor might be better to allow us to have a clean downstream patch without really harming upstream code. My initial suggestion would be to change to something like this:
Could you clarify the actual intended use-case of this option? I'm just trying to understand the situation before suggesting more things, as I realise some suggestions aren't useful for specific use-cases.
Looks good to me.
Dec 11 2020
No more comments from me at this time, but as before, I'd prefer others to confirm they're happy with the concept.
Seems reasonable to me. I guess in some of the existing tests, they should be checking the addend in the relocated data, but if they don't already, we aren't making the situation worse. LGTM, with nits.
The test is currently failing on the pre-merge bot :-)
Dec 10 2020
You need testing to show that --preserve-dates doesn't preserve dates when the content has been modified.
Dec 9 2020
The test is failing on the pre-merge bots. Please fix.