diff options
author | Dmitry Chestnykh <dm.chestnykh@gmail.com> | 2024-02-19 07:55:10 +0300 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2024-02-19 09:23:59 +0100 |
commit | 0d308e51f936c5395f62cc70e0098d7e16a07361 (patch) | |
tree | 7946c9592917b985d7ba7f547fc9f0fe69c966d0 /ldso/include/dl-elf.h | |
parent | ee2451840716526ad0f0abc1754d835d6b6970a6 (diff) |
Rename `reloc_addr` to suppress `-Wshadow` warning.
Here is the warning:
ldso/ldso/dl-elf.c: In function '_dl_fixup':
./ldso/include/dl-elf.h:259:37: warning: declaration of 'reloc_addr' shadows a previous local [-Wshadow]
259 | ElfW(Addr) *reloc_addr = 0; \
| ^~~~~~~~~~
./ldso/include/dl-elf.h:290:33: note: in expansion of macro 'DL_DO_RELOCATE_RELR'
290 | DL_DO_RELOCATE_RELR(dyn->loadaddr, relr_start, relr_end); \
| ^~~~~~~~~~~~~~~~~~~
ldso/ldso/dl-elf.c:1032:9: note: in expansion of macro 'DL_RELOCATE_RELR'
1032 | DL_RELOCATE_RELR(tpnt);
| ^~~~~~~~~~~~~~~~
In file included from ldso/ldso/ldso.c:1462:
ldso/ldso/dl-elf.c:1012:20: note: shadowed declaration is here
1012 | ElfW(Addr) reloc_addr
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
Diffstat (limited to 'ldso/include/dl-elf.h')
-rw-r--r-- | ldso/include/dl-elf.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h index 7d514c0f5..7143b572c 100644 --- a/ldso/include/dl-elf.h +++ b/ldso/include/dl-elf.h @@ -256,22 +256,22 @@ unsigned int __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info #define DL_DO_RELOCATE_RELR(load_addr, relr_start, relr_end) \ do { \ const ElfW(Relr) *relr = 0; \ - ElfW(Addr) *reloc_addr = 0; \ + ElfW(Addr) *relr_reloc_addr = 0; \ for (relr = relr_start; relr < relr_end; relr++) { \ ElfW(Relr) relr_entry = *relr; \ if (!(relr_entry & 1)) \ { \ - reloc_addr = (ElfW(Addr) *)DL_RELOC_ADDR(load_addr, relr_entry); \ - *reloc_addr = (ElfW(Addr))DL_RELOC_ADDR(load_addr, reloc_addr); \ - reloc_addr++; \ + relr_reloc_addr = (ElfW(Addr) *)DL_RELOC_ADDR(load_addr, relr_entry); \ + *relr_reloc_addr = (ElfW(Addr))DL_RELOC_ADDR(load_addr, relr_reloc_addr); \ + relr_reloc_addr++; \ } \ else \ { \ for (long int i = 0; (relr_entry >>= 1) != 0; ++i) { \ if ((relr_entry & 1) != 0) \ - reloc_addr[i] = (ElfW(Addr))DL_RELOC_ADDR(load_addr, reloc_addr[i]); \ + relr_reloc_addr[i] = (ElfW(Addr))DL_RELOC_ADDR(load_addr, relr_reloc_addr[i]); \ } \ - reloc_addr += CHAR_BIT * sizeof(ElfW(Relr)) - 1; \ + relr_reloc_addr += CHAR_BIT * sizeof(ElfW(Relr)) - 1; \ } \ } \ } while (0); |