https://sourceware.org/bugzilla/show_bug.cgi?id=32311
--- Comment #9 from User441669 ---
Compilation successfully! I plan to close this issue as fixed, and send this
patch to the OpenWrt project (named `007-fix-null-dereference-with-lto.patch`
in the attachments)
linker prints some warnings, loo
https://sourceware.org/bugzilla/show_bug.cgi?id=32311
--- Comment #8 from User441669 ---
Created attachment 15783
--> https://sourceware.org/bugzilla/attachment.cgi?id=15783&action=edit
elfutils-success.log
The full log after a successful compilation.
--
You are receiving this mail because:
https://sourceware.org/bugzilla/show_bug.cgi?id=32311
--- Comment #7 from User441669 ---
Created attachment 15782
--> https://sourceware.org/bugzilla/attachment.cgi?id=15782&action=edit
007-fix-null-dereference-with-lto.patch
The patch that fixes everything
--
You are receiving this mail bec
Hi Aaron,
On Wed, Nov 06, 2024 at 04:15:30PM -0500, Aaron Merey wrote:
> On Wed, Nov 6, 2024 at 2:35 PM Mark Wielaard wrote:
> > >if (reloc_debug_only)
> > > {
> > > + if (ehdr->e_type != ET_REL)
> > > + {
> > > + /* Only ET_REL files should have debug relocations to remov
Hi Mark,
On Wed, Nov 6, 2024 at 2:35 PM Mark Wielaard wrote:
> >if (reloc_debug_only)
> > {
> > + if (ehdr->e_type != ET_REL)
> > + {
> > + /* Only ET_REL files should have debug relocations to remove. */
> > + error (0, 0, _("Ignoring --reloc-debug-sections-only fo
Hi Aaron,
On Tue, Nov 05, 2024 at 05:53:38PM -0500, Aaron Merey wrote:
> strip --reloc-debug-sections-only is expected to be a no-op for
> non-ET_REL files. This was not enforced in the code. Sections
> were copied over to a new output file and normally its contents
> would be identical to the i
Hi Anton,
> +#define NAME_MAX_SIZE (32 * 17 + 32 + 1)
> +static_assert(NAME_MAX_SIZE == (32 * 17 + 32 + 1), "Buffer size for 'name'
> is insufficient");
This is indeed a static_assert. But doesn't really add any value. It
just checks the calculation one line above. But doesn't explain or
check w
Some compilers assume the second call to elf[32|64]_getshdr can fail
and produce error: potential null pointer dereference. Just store the
result of the first call and reuse (when not NULL).
* libelf/elf_compress.c (elf_compress): Store getshdr result in
a shdr union var.
* li
https://sourceware.org/bugzilla/show_bug.cgi?id=32311
--- Comment #6 from Mark Wielaard ---
(In reply to User441669 from comment #4)
> Just one more step!
>
Indeed! There was one typo in the patch (forgot to remove one line):
diff --git a/libelf/elf_compress.c b/libelf/elf_compress.c
index 387
https://sourceware.org/bugzilla/show_bug.cgi?id=32311
--- Comment #5 from User441669 ---
(In reply to Mark Wielaard from comment #3)
> Unfortunately I cannot replicate the warning/error even with -flto.
I have no ideas about this. It might be related to the compiler version or musl
libc
--
You
https://sourceware.org/bugzilla/show_bug.cgi?id=32311
--- Comment #4 from User441669 ---
Just one more step!
Error log:
```text
aarch64-openwrt-linux-musl-gcc-ranlib libelf_pic.a
ccache aarch64-openwrt-linux-musl-gcc -std=gnu99 -Wall -Wshadow -Wformat=2
-Wold-style-definition -Wstrict-prototype
Report of the static analyzer:
Pointer, returned from function 'elf_getarhdr'
at ar.c:498, may be NULL and is dereferenced at ar.c:500.
Corrections explained:
The issue is that the pointer returned by elf_getarhdr(subelf) may be NULL,
but it is directly dereferenced without a NULL check.
This f
From: AntonMoryakov
first report of the static analyzer:
A string is copied into the buffer 's' of size 577 without checking its length
first at sparc_attrs.c:95.
Corrections explained:
Added static_assert to check the size of the name buffer at compile time.
This static_assert will assert tha
13 matches
Mail list logo