From 0df8ad28f0f727fab3a696d6c98b9a8a77ee1024 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 26 Apr 2018 15:12:42 +0100 Subject: Extend the assembler so that it can automatically generate GNU Build attribute notes if none are present in the input files. gas * as.c (flag_generate_build_notes): New variable. (show_usage): Add entry for --generate-missing-build-notes. (parse_args): Parse --generate-missing-build-notes. * as.h: Export flag_generate_build_notes. * symbols.c (save_symbol_name): Ensure that the name parameter is not NULL. * write.c (create_obj_attrs_section): Reformat. (create_note_reloc): New function - creates a relocation for a field in a GNU Build attribute note. (maybe_generate_build_notes): New function - created GNU Build attribute notes if none are present in the output file. (write_object_file): Call maybe_generate_build_notes. * configure.ac (--enable-generate-build-notes): New option. * NEWS: Announce the new feature. * doc/as.textinfo: Document the new option. * config.in: Regenerate. * configure: Regenerate. binutils* readelf.c (is_32bit_abs_reloc): Support R_PARISC_DIR32 as a 32-bit absolute reloc for the HPPA target. * testsuite/binutils-all/note-5.d: New test. * testsuite/binutils-all/note-5.s: Source file for new test. * testsuite/binutils-all/objcopy.exp: Run new test. --- gas/as.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gas/as.h') diff --git a/gas/as.h b/gas/as.h index d75ff42..52bb5a7 100644 --- a/gas/as.h +++ b/gas/as.h @@ -595,6 +595,10 @@ COMMON int flag_allow_nonconst_size; /* If we should generate ELF common symbols with the STT_COMMON type. */ extern int flag_use_elf_stt_common; +/* TRUE iff GNU Build attribute notes should + be generated if none are in the input files. */ +extern bfd_boolean flag_generate_build_notes; + /* If section name substitution sequences should be honored */ COMMON int flag_sectname_subst; #endif -- cgit v1.1