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

(Ongoing) Go1.22.1 Merge #29

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cookiengineer
Copy link

@cookiengineer cookiengineer commented Mar 20, 2024

As I've hinted in #28 this is the ongoing merge to keep up with go1.22.1 (the last stable tag of upstream golang).

DO NOT MERGE

STATUS

  • dwarf (doesn't have exports/Write functionality yet)
  • elf (see comments in pull request thread)
  • goobj2 (see Documentation request(?): goobj2 folder #28 )
  • gosym
  • macho
  • pe
  • plan9obj (doesn't have exports/Write functionality yet)

Currently, this is not finished. I wanted to have an open pull request so you guys can chime in/intervene if I'm missing something that you added as functionality in your fork, and that we have a place to discuss what's missing.

I'm trying to use commits on a per-subfolder basis, so that changes are easier to git bisect in case there's a problem with the merged files.

@cookiengineer
Copy link
Author

cookiengineer commented Mar 20, 2024

Notes on 📦 elf:

  • Reused the Header32 and Header64 structs as a pointer in the File struct which fixes all TODOs in the former write.go (now file_write.go to match upstream convention)
  • Symbol.NameIndex and Symbol.SectIndex wasn't used anywhere, it was removed
  • SHT offset and SHT index are now always matched with the ELF Header, so there's no magic constants inside the File.Bytes() method anymore, and it fixes the remaining TODOs in there as well.
  • Inlined SHT_DYNAMIC section parsing, and recorrected its position inside the NewFile() method (e.g. the checks for no sections etc should have come before the parseDynamicTags() call.
  • DynTag is a uint64, and all Values are constants now, to keep compatibility with upstream the DynTags have been rewritten to File.DynTags map[DynTag]uint64, so that constants can be reused for comparison.
  • SectionHeader.Index property added to be able to convert to/from Section32/Section64

@cookiengineer
Copy link
Author

Questions / TODO

  • plan9obj needs support for Injection and InjectionEOF properties

  • dwarf needs support for Injection and InjectionEOF properties

  • Do you know how to test these in practice?

  • Maybe it makes sense to add a CI/CD pipeline here on GitHub with different architectures to run the tests against the testdata folders/binaries which are also included upstream?

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.

1 participant