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

Stop crashing on RELR sections. #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

woutershep
Copy link

I just added the new constants to the file and it works for my use case.
I have no idea if this is enough or even correct though...

Please see https://maskray.me/blog/2021-10-31-relative-relocations-and-relr

I just added the new constants to the file and it works for my use case.
I have no idea if this is enough or even correct though...

Please see https://maskray.me/blog/2021-10-31-relative-relocations-and-relr
@heirecka
Copy link

Seems to work for my purposes as well. But maybe section.rb should be teached about RELR too:

diff --git a/lib/elf/section.rb b/lib/elf/section.rb
index 41c8fc7..283a2a9 100644
--- a/lib/elf/section.rb
+++ b/lib/elf/section.rb
@@ -270,6 +270,7 @@ module Elf
              16 => [ :PreinitArray, 'Array of pre-constructors' ],
              17 => [ :Group, 'Section group' ],
              18 => [ :SymTabShndx, 'Extended section indeces' ],
+             19 => [ :Relr, 'RELR relative relocations' ],
              # OS-specific range start
              0x6ffffff8 => [ :Checksum, 'Checksum for DSO content' ]
              # OS-specific range end

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.

2 participants