Skip to content

Commit

Permalink
Add comment about uniqueness of sections
Browse files Browse the repository at this point in the history
  • Loading branch information
0152la committed Feb 21, 2024
1 parent 9e6adce commit 344cce8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/compartment.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,14 @@ parse_lib_file(char *lib_name, struct Compartment *new_comp)
// corresponding symbols as 0, 4, and 8.

// Traverse sections once to get headers for sections of interest
//
// XXX According to the ELF specification version 1.2, for UNIX, there are
// only one of each `SHT_SYMTAB`, `SHT_DYNSYM`, and `SHT_DYNAMIC`. Further,
// we assume there can only be one section with the name `.rela.plt`.
// Therefore, we expect each `if` to be only entered once. However, we not
// that this can be changed in future specifications.
//
// Source: https://refspecs.linuxfoundation.org/elf/elf.pdf
const size_t headers_of_interest_count = 3;
size_t found_headers = 0;
Elf64_Shdr curr_shdr;
Expand Down

0 comments on commit 344cce8

Please sign in to comment.