diff --git a/src/elf_link_elf.c b/src/elf_link_elf.c index 2e9b565bd59c8d7ad5b4dde6ed604d0003f95b24..f34dee002edbd9081239c493f49814e055743c52 100644 --- a/src/elf_link_elf.c +++ b/src/elf_link_elf.c @@ -1024,8 +1024,9 @@ static int dynamic_merge_lib_one(elf_link_t *elf_link, elf_file_t *ef, Elf64_Dyn continue; } // In static-pic mode, all DT_NEEDED should be deleted. - if (!is_share_mode(elf_link)) + if (!is_share_mode(elf_link)) { continue; + } *dst_dyn = *dyn; // fix name index dst_dyn->d_un.d_val = get_new_name_offset(elf_link, ef, ef->dynstr_sec, dyn->d_un.d_val); @@ -1229,8 +1230,9 @@ static inline Elf64_Addr get_symbol_new_value(elf_link_t *elf_link, elf_file_t * // _DYNAMIC is the the start of .dynamic // _GLOBAL_OFFSET_TABLE_ is ok if compiled with -znow if (sym->st_shndx == SHN_ABS) { - if (elf_is_same_symbol_name("_DYNAMIC", name)) + if (elf_is_same_symbol_name("_DYNAMIC", name)) { return elf_link->out_ef.dynamic_Phdr->p_vaddr; + } } // STT_TLS symbol st_value is offset to TLS segment begin diff --git a/src/elf_read_elf_xz.c b/src/elf_read_elf_xz.c index 47b9c03cb33b1e558c6db76d650f7a65d52253a6..3fc2c798b1e571a26cec2e21e231faa9f574dada 100644 --- a/src/elf_read_elf_xz.c +++ b/src/elf_read_elf_xz.c @@ -67,8 +67,9 @@ static int xz_uncompress(lzma_stream *strm, elf_file_t *ef) } strm->next_in = in_buf; strm->avail_in = rdret; - if (rdret == 0) + if (rdret == 0) { action = LZMA_FINISH; + } } ret = lzma_code(strm, action); if (strm->avail_out == 0 || ret != LZMA_OK) { @@ -84,8 +85,9 @@ static int xz_uncompress(lzma_stream *strm, elf_file_t *ef) strm->next_out = out_buf; strm->avail_out = BUFSIZ; } - if (ret == LZMA_STREAM_END) + if (ret == LZMA_STREAM_END) { break; + } if (ret != LZMA_OK) { xz_uncompress_log_err(ret); ret = -EINVAL; diff --git a/src/elf_relocation_aarch64.c b/src/elf_relocation_aarch64.c index 1e895e8bf7bfdf5763ff815b61141cdc526b8127..cd1e5f56788e7624ea5cfc28cd9b3167c82b5ed1 100644 --- a/src/elf_relocation_aarch64.c +++ b/src/elf_relocation_aarch64.c @@ -1053,8 +1053,9 @@ void correct_stop_libc_atexit(elf_link_t *elf_link) } old_adrp_addr = addr; } - if (!old_adrp_addr) + if (!old_adrp_addr) { si_panic("%s, didn't find matched adrp in __run_exit_handlers()\n", __func__); + } /* compute got addr from ldr and adrp in out_ef */ unsigned long new_adrp_addr = get_new_addr_by_old_addr(elf_link, template_ef, old_adrp_addr);