From: Nick Clifton Date: Thu, 19 Sep 2024 15:45:30 +0000 (+0100) Subject: ld: Move the .note.build-id section to near the start of the memory map. X-Git-Tag: gdb-16-branchpoint~881 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf6d7087de0;p=thirdparty%2Fbinutils-gdb.git ld: Move the .note.build-id section to near the start of the memory map. This helps GDB to locate the debug information associated with a core dump. Core dumps include the first page of an executable's image, and if this page include the .note.build-id section then GDB can find it and then track down a debug info file for that build-id. --- diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index 54716110b61..6ef93dcc906 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -397,6 +397,19 @@ fi # =========================================================================== # Functions for generating parts of the linker script +# Helper function for putting comments into scripts. +# Useful when trying to track down script composition problems. +# Use by adding: +# emit_comment "a message" +# wherever necessary. + +emit_comment() +{ +cat <