From 2167ddf6838b5d338b806e0d4c5ce6968cebb0b8 Mon Sep 17 00:00:00 2001 From: l00580197 Date: Wed, 12 Jul 2023 14:08:19 +0800 Subject: [PATCH] fix codex --- src/elf_link_elf.c | 6 ++++-- src/elf_read_elf_xz.c | 6 ++++-- src/elf_relocation_aarch64.c | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/elf_link_elf.c b/src/elf_link_elf.c index 2e9b565..f34dee0 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 47b9c03..3fc2c79 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 1e895e8..cd1e5f5 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); -- Gitee