-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add support for .gnu.attributes sections #509
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
ULEB128 support is fairly simple. We could add it to Bytes
instead of needing to add dependencies. That can be left for a later PR though.
Do you know how to create a file with a .gnu.attributes section? I tried compiling with powerpc-linux-gnu-gcc and powerpc64-linux-gnu-gcc but it doesn't produce this section. |
I was seeing it with little endian, so maybe |
This adds partial support for
SHT_GNU_ATTRIBUTES
sections, which is of primary importance on powerpc systems since the endianness is specified as a file tag. For example see the Tag_GNU_Power_ABI_FP tag.The details on the section format can be found here in section 4.3.6: https://static1.squarespace.com/static/59c4375b8a02c798d1cce06f/t/59d55a5a32601e2413a23988/1507154526861/ELF+for+ARM.pdf
This series only handles file tags, since they are the most straightforward. The symbol and section tag format requires being able to interact with ULEB128-encoded values, which I did not find an easy way to do without bringing in lots of third party dependencies. The file tags are the most common however, and paired with #508 allows for copying ppc64 shared libraries.