From 4b72a278f46245635ca03ffc8179570c07e3531a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 28 Feb 2024 18:53:52 +1030 Subject: PR23881, pdp11 binutils fails if too much debug data The PR testcase overflows one of the exec header fields, e_syms (the size of the symbol table), leading to the string table offset being wrong. Things go downhill from there. Fixed by checking for overflow. This happens to trigger in the ld testsuite, so xfail that test. PR 23881 bfd/ * libaout.h (swap_exec_header_out): Return a bool. * aoutx.h (swap_exec_header_out): Check for overflow in exec header. * pdp11.c (swap_exec_header_out): Likewise. * i386lynx.c (WRITE_HEADERS): Adjust. ld/ * testsuite/ld-scripts/map-address.exp: xfail pdp11. --- bfd/i386lynx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bfd/i386lynx.c') diff --git a/bfd/i386lynx.c b/bfd/i386lynx.c index cd06a64..1d4c411 100644 --- a/bfd/i386lynx.c +++ b/bfd/i386lynx.c @@ -46,7 +46,8 @@ * obj_reloc_entry_size (abfd)); \ execp->a_drsize = ((obj_datasec (abfd)->reloc_count) \ * obj_reloc_entry_size (abfd)); \ - NAME (aout, swap_exec_header_out) (abfd, execp, &exec_bytes); \ + if (!NAME (aout, swap_exec_header_out) (abfd, execp, &exec_bytes)) \ + return false; \ \ if (bfd_seek (abfd, 0, SEEK_SET) != 0 \ || bfd_write (&exec_bytes, EXEC_BYTES_SIZE, \ -- cgit v1.1