diff --git a/src/compartment.c b/src/compartment.c index 7279ec8..fbda2f1 100644 --- a/src/compartment.c +++ b/src/compartment.c @@ -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;