[PATCH] elf: Avoid relocating non-allocated code sections

Alan Modra amodra@gmail.com
Thu Jul 30 02:37:57 GMT 2026


On Thu, Jul 30, 2026 at 08:33:19AM +0800, H.J. Lu wrote:
> Since non-allocated code sections can't be properly relocated, issue an
> error on such input.
> 
> PR ld/34444
> * elflink.c (elf_link_input_bfd): Issue an error on a non-allocated
> code section.

This is not a proper fix for the bug, which is caused by a reloc offset
out of range.  The weird flags are just something you see with fuzzed
object files.  You could likely modify the flags to something more
normal and would still see the buffer overflow.

-- 
Alan Modra


More information about the Binutils mailing list