diff --git a/src/elf_check_elf.c b/src/elf_check_elf.c index 6b77dd683830f8c5fe334f5519f256917b9a0d58..241e9d4af863cc6b577376a26a32b4ed1ec1cbe6 100644 --- a/src/elf_check_elf.c +++ b/src/elf_check_elf.c @@ -3,10 +3,11 @@ #include #include -#include "elf_link_common.h" #include #include +#include "elf_link_common.h" + static void check_bss_addr(elf_file_t *out_ef) { // in kernel, bss addr = data segment + filesize @@ -40,8 +41,9 @@ static bool is_dynsym_valid(Elf64_Sym *sym, const char *name) return true; } - if (sym->st_shndx == SHN_UNDEF) + if (sym->st_shndx == SHN_UNDEF) { return false; + } return true; } @@ -80,8 +82,9 @@ static void check_dynamic(elf_link_t *elf_link) elf_file_t *out_ef = &elf_link->out_ef; Elf64_Shdr *sec = elf_find_section_by_name(out_ef, ".dynamic"); - if (is_share_mode(elf_link) == false) + if (is_share_mode(elf_link) == false) { return; + } // dyn mode must be DT_BIND_NOW dyn_count = sec->sh_size / sec->sh_entsize; diff --git a/src/elf_hugepage.c b/src/elf_hugepage.c index 0fa87ed97b57cbd4ccec783d9535e8318f0ed600..7310d6f70fd897f25664b11214e94da0a7db5a60 100644 --- a/src/elf_hugepage.c +++ b/src/elf_hugepage.c @@ -54,11 +54,13 @@ void elf_set_hugepage(elf_link_t *elf_link) Elf64_Phdr *phdr = (Elf64_Phdr *)ef->hdr_Phdr; for (i = 0; i < count; i++) { - if (phdr[i].p_type == PT_LOAD) { - if (exec_only && !(phdr[i].p_flags & PF_X)) - continue; - phdr[i].p_flags |= PF_HUGEPAGE; + if (phdr[i].p_type != PT_LOAD) { + continue; } + if (exec_only && !(phdr[i].p_flags & PF_X)) { + continue; + } + phdr[i].p_flags |= PF_HUGEPAGE; } _elf_set_aot(ef, true);