From 496917ce466c703c1ae3bf1cbbe753de1c091445 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 10 May 2023 10:29:52 +0100 Subject: Add linker option to include local symbols in the linker map. PR 16566 * ldlang.c (ld_is_local_symbol): New function. (print_input_section): Add code to display local symbols in the section. * ldlex.h (enum option_values): Add OPTION_PRINT_MAP_LOCALS and OPTION_PRINT_MAP_LOCALS. * lexsup.c (ld_options[]): Add entries for --print-map-locals and --no-print-map-locals. * NEWS: Mention the new feature. * ld.h (struct ld_config_type): Add print_map_locals field. * ld.texi: Document the new command line option. * testsuite/ld-scripts/sizeof.s: Add a local symbol. * testsuite/ld-scripts/map-locals.d: New test control file. * testsuite/ld-scripts/map-address.exp: Run the new test. --- ld/ldlex.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ld/ldlex.h') diff --git a/ld/ldlex.h b/ld/ldlex.h index 48d323d..be942ec 100644 --- a/ld/ldlex.h +++ b/ld/ldlex.h @@ -160,6 +160,8 @@ enum option_values OPTION_FORCE_GROUP_ALLOCATION, OPTION_PRINT_MAP_DISCARDED, OPTION_NO_PRINT_MAP_DISCARDED, + OPTION_PRINT_MAP_LOCALS, + OPTION_NO_PRINT_MAP_LOCALS, OPTION_NON_CONTIGUOUS_REGIONS, OPTION_NON_CONTIGUOUS_REGIONS_WARNINGS, OPTION_DEPENDENCY_FILE, -- cgit v1.1