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

Some explanation about struct section_list #21

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/intercept.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ struct patch_desc {

void patch_apply(struct patch_desc *patch);

/*
* A section_list struct contains information about sections where
* libsyscall_intercept looks for jump destinations among symbol addresses.
* Generally, only two sections are used for this, so 16 should be enough
* for the maximum number of headers to be stored.
*
* See the calls to the add_table_info routine in the intercept_desc.c source
* file.
*/
struct section_list {
Elf64_Half count;
Elf64_Shdr headers[0x10];
Expand Down
2 changes: 2 additions & 0 deletions src/intercept_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ add_table_info(struct section_list *list, const Elf64_Shdr *header)
if (list->count < max) {
list->headers[list->count] = *header;
list->count++;
} else {
xabort("allocated section_list exhausted");
}
}

Expand Down