[tnozaki-elftoolchain] TNF local patch for libelf - LIBELF_COPY_U32/LIBELF_COPY_S32 range check
Issue #275
resolved
No description provided.
Comments (4)
-
reporter -
reporter oops, LIBELF_COPY_S32() case:
$ grep LIBELF_COPY_S32 ./dist/_libelf.h:#define LIBELF_COPY_S32(DST,SRC,NAME) do { \ ./dist/gelf_dyn.c: LIBELF_COPY_S32(dyn32, ds, d_tag); ./dist/gelf_rela.c: LIBELF_COPY_S32(rela32, dr, r_addend); $ grep d_tag elf_types.m4 ``d_tag, SWORD', ``d_tag, SXWORD', $ grep r_addend elf_types.m4 `r_addend, SWORD', `r_addend, SXWORD',
only copy signed integer, unsigned integer is not used.
so previous comment is wrong, there’s no bug here.
-
reporter BUGFIX: Issue
- TNF local patch for libelf LIBELF_COPY_U32/LIBELF_COPY_S32 range check cast u?int64_t for -Werror=type-limits#275→ <<cset a25da0ff27ddbd02c84d42b89dab7596d1b5a07b>>
-
reporter - changed title to [tnozaki-elftoolchain] TNF local patch for libelf - LIBELF_COPY_U32/LIBELF_COPY_S32 range check
- Log in to comment
original code has bug, but thorpej's fix may causes another problem…
LIBELF_COPY_U32:
(SRC)->NAME mat take:
so this comparison may cause no effect when type is uint32_t.
but gcc -Wtype-limits may not detect it unlike (SRC)->NAME < 0.
lint(1) may cause alarm?
LIBELF_COPY_S32:
(SRC)->NAME may take:
consider following case:
x < INT32_MIN
may not work correctly, apparently BUG