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

Add elf_relocations table #20

Merged
merged 4 commits into from
Feb 19, 2024
Merged

Add elf_relocations table #20

merged 4 commits into from
Feb 19, 2024

Conversation

fzakaria
Copy link
Owner

@fzakaria fzakaria commented Feb 19, 2024

Add the new elf_relocations table.

Not 100% sure how I want to leverage it but the markings of the table are there.
I have also included a new example directory for object creation.

A few examples:

sqlelf> select * from elf_relocations LIMIT 5;
┌───────────────────────────────────┬────────┬──────┬─────────┬─────────┬─────────────┬────────┬──────────────┬──────┐
│               path                │ addend │ info │ is_rela │ purpose │   section   │ symbol │ symbol_table │ type │
│ examples/object-relocations/sum.o │ 0      │ 4    │ 1       │ OBJECT  │ .debug_info │        │ .symtab      │ R32  │
│ examples/object-relocations/sum.o │ 11     │ 6    │ 1       │ OBJECT  │ .debug_info │        │ .symtab      │ R32  │
│ examples/object-relocations/sum.o │ 92     │ 7    │ 1       │ OBJECT  │ .debug_info │        │ .symtab      │ R32  │
│ examples/object-relocations/sum.o │ 0      │ 7    │ 1       │ OBJECT  │ .debug_info │        │ .symtab      │ R32  │
│ examples/object-relocations/sum.o │ 0      │ 2    │ 1       │ OBJECT  │ .debug_info │        │ .symtab      │ R64  │
└───────────────────────────────────┴────────┴──────┴─────────┴─────────┴─────────────┴────────┴──────────────┴──────┘
sqlelf> select * from elf_relocations LIMIT 5;
┌─────────────────────────────────┬────────┬──────┬─────────┬─────────┬─────────┬─────────────────────────────┬──────────────┬──────────┐
│              path               │ addend │ info │ is_rela │ purpose │ section │           symbol            │ symbol_table │   type   │
│ examples/object-relocations/exe │ 4400   │ 0    │ 1       │ DYNAMIC │ NULL    │                             │ NULL         │ RELATIVE │
│ examples/object-relocations/exe │ 4336   │ 0    │ 1       │ DYNAMIC │ NULL    │                             │ NULL         │ RELATIVE │
│ examples/object-relocations/exe │ 16408  │ 0    │ 1       │ DYNAMIC │ NULL    │                             │ NULL         │ RELATIVE │
│ examples/object-relocations/exe │ 0      │ 1    │ 1       │ DYNAMIC │ NULL    │ __libc_start_main           │ NULL         │ GLOB_DAT │
│ examples/object-relocations/exe │ 0      │ 2    │ 1       │ DYNAMIC │ NULL    │ _ITM_deregisterTMCloneTable │ NULL         │ GLOB_DAT │
└─────────────────────────────────┴────────┴──────┴─────────┴─────────┴─────────┴─────────────────────────────┴──────────────┴──────────┘

A relocations table fleshed out.
Not 100% sure how I want to leverage it but the markings of the table
are there.
@fzakaria
Copy link
Owner Author

@markrwilliams lets think of interesting queries.
max relocation distance?

* removed redundant cast when bumped to 0.14.1 for LIEF
@fzakaria fzakaria merged commit 1ef70d5 into main Feb 19, 2024
2 checks passed
@fzakaria fzakaria deleted the relocations branch February 19, 2024 03:27
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