Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MIPS64 .o files - don't remove has_addend #495

Merged
merged 6 commits into from
Sep 4, 2023

Conversation

noamraph
Copy link
Contributor

A slightly modified #493

Noam Yorav-Raphael and others added 5 commits August 24, 2023 15:39
…y having two _RELOCATION_RECIPES_MIPS, one for REL and one for RELA
Now we don't depend on whether relocations on globals in .o should be performed or not.
@noamraph noamraph mentioned this pull request Aug 29, 2023
Copy link
Owner

@eliben eliben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks better to me. @sevaa WDYT?

@eliben
Copy link
Owner

eliben commented Aug 31, 2023

I like that this decouples the has_addend refactoring from the specific MIPS64 change. We can consider a separate has_addend refactoring PR once this one lands.

@sevaa specifically I'd like you to review the run_dwarfdump_tests changes here

@sevaa
Copy link
Contributor

sevaa commented Aug 31, 2023

@noamraph: may I hear more about the (0x0000000000000000 ".text") discrepancy? Where is it, exactly?

In general, we prefer to make the output of our scripts match the reference tool output, rather than introduce special cases on testing. If the tool output format evolves over time (like readelf's) - oh well, life goes on.

@noamraph
Copy link
Contributor Author

@sevaa here's the diff:
image

I tried modifying dwarfdump.py for just adding ".text" for DW_FORM_addr with value=0, but it turns out that in other ELF files llvm-dwarfdump didn't add it. I'm not sure why llvm-dwarfdump added the ".text" here and not in other files. It may be related to this being a .o.

I can modify dwarfdump.py to add ".text" to DW_FORM_addr with value=0 on "relocatable" ELF files. Would that be better than just ignoring it in the output?

@sevaa
Copy link
Contributor

sevaa commented Sep 1, 2023

Have you checked the llvm-dwarfdump sources?

@noamraph
Copy link
Contributor Author

noamraph commented Sep 3, 2023

@sevaa I tried to look in llvm-dwarfdump sources, and didn't find the place where it prints the address.
Is there a chance we could continue without going to the root of this? After all, the DWARF parsing is obviously correct. The dwarfdump output is also correct, it just doesn't match exactly the llvm-dwarfdump output. The question is, could we add support for MIPS64 .o DWARF parsing without understanding when exactly llvm-dwarfdump prints the section name.

Thanks,
Noam

@sevaa
Copy link
Contributor

sevaa commented Sep 3, 2023

Every time we introduce a special case treatment in the test runner, it leaves a bad taste in my mouth :) That said, no hard veto.

@noamraph
Copy link
Contributor Author

noamraph commented Sep 4, 2023

@sevaa I feel the bad taste as well, and I would really like to understand llvm-dwarfdump further and update dwarfdump.py accordingly. But there's a good chance I won't have the time. So I would understand it if you will reject adding support for MIPS64 .o in order to keep the test clean, but I would appreciate it if you would agree to add it.

Anyway, I pushed another commit which I think makes the special-case a bit more localized in run_dwarfdump_test.py, and adds a comment explaining it.

What do you think?

@eliben
Copy link
Owner

eliben commented Sep 4, 2023

The test runner exception is now targeted enough, I feel alright with it. Merging.

@eliben eliben merged commit c9e558f into eliben:master Sep 4, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants