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

Move VirtAddrMap out of ElfEdit.Dynamic #18

Open
langston-barrett opened this issue Jun 29, 2020 · 5 comments
Open

Move VirtAddrMap out of ElfEdit.Dynamic #18

langston-barrett opened this issue Jun 29, 2020 · 5 comments
Assignees

Comments

@langston-barrett
Copy link
Contributor

This datatype isn't intrinsically related to dynamically-linked executables, so its placement in this module is a bit misleading.

@langston-barrett langston-barrett self-assigned this Jun 29, 2020
@joehendrix
Copy link
Contributor

I view that as a pretty simple data that is used to support the needs of parsing the dynamic section. It's it's useful for dynamic libraries and executables. I suppose it could be used for static executables as well, but not for object files.

I'm not opposed to having it in a separate module though if that would be useful, and you want to submit a PR.

@langston-barrett
Copy link
Contributor Author

Ah, I didn't think of it as specific to the parsing of the dynamic section because it is exported. Perhaps we should just not export it instead? Which would be best?

@joehendrix
Copy link
Contributor

I don't know what would be best. What's the goal of either change?

@joehendrix
Copy link
Contributor

I took a brief look to repage things in and it looks like it's only used to support the Android relocation entries in Macaw. Maybe there's some other way to refactor that code so we don't need this type, but I don't understand the goal.

@langston-barrett
Copy link
Contributor Author

Sorry if my comments were unclear, let me back up a bit. At the moment, VirtAddrMap and a handful of operations on it are exported out of ElfEdit.Dynamic, and then again out of ElfEdit. I think that every part of a library's API should:

  1. be generally useful outside of that library's implementation, and
  2. be organized logically into modules

among other things. Since VirtAddrMap is exported, I assumed that it was generally useful (1). Since it doesn't seem intrinsically tied to dynamically linked code (as you say, it could be used for static executables), I thought it should go in a module that's not specifically related to dynamically linked code (2).

Then you said:

I view that as a pretty simple data that is used to support the needs of parsing the dynamic section.

So I thought my assumption (1) was flawed, and so instead of making this type and its operations more suitable for exposing through the API, maybe we should just not export it and keep it internal to ElfEdit.Dynamic.

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

No branches or pull requests

2 participants