diff options
author | Douglas B Rupp <rupp@adacore.com> | 2020-05-18 21:29:53 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-05-18 22:41:32 +0930 |
commit | 3edf7b9f2c79be0bffcc05d7a8b4364924255282 (patch) | |
tree | cf499e1cc207f511163402eda4591ac965657fc7 /ld/emultempl | |
parent | 6e0c75f7c4a94e835842f52aadb4e1a83c3b4e0a (diff) | |
download | gdb-3edf7b9f2c79be0bffcc05d7a8b4364924255282.zip gdb-3edf7b9f2c79be0bffcc05d7a8b4364924255282.tar.gz gdb-3edf7b9f2c79be0bffcc05d7a8b4364924255282.tar.bz2 |
Show AIX gc'd symbol address adjustments in map file
* ldemul.h (ldemul_print_symbol): New.
(ld_emulation_xfer_type) <print_symbol): Likewise.
* ldemul.c (ldemul_print_symbol): New.
* ldlang.c (SECTION_NAME_MAP_LANGTH): Move to ...
(print_one_symbol): Make global and move declaration to ...
(print_all_symbols): Rename print_one_symbol to ldemul_print_symbol
(print_input_section): Likewise
* ldlang.h: ... here.
* emultempl/aix.em (gld${EMULATION_NAME}_print_symbol): New.
(ld_emulation_xfer_struct): Use it.
* emultempl/armcoff.em (ld_emulation_xfer_struct): Add print_symbol
and default to NULL.
* emultempl/beos.em (ld_emulation_xfer_struct): Likewise
* emultempl/elf.em (ld_emulation_xfer_struct): Likewise
* emultempl/generic.em (ld_emulation_xfer_struct): Likewise
* emultempl/linux.em (ld_emulation_xfer_struct): Likewise
* emultempl/msp430.em (ld_emulation_xfer_struct): Likewise
* emultempl/pe.em (ld_emulation_xfer_struct): Likewise
* emultempl/pep.em (ld_emulation_xfer_struct): Likewise
* emultempl/ticoff.em (ld_emulation_xfer_struct): Likewise
* emultempl/vanilla.em (ld_emulation_xfer_struct): Likewise
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/aix.em | 33 | ||||
-rw-r--r-- | ld/emultempl/armcoff.em | 3 | ||||
-rw-r--r-- | ld/emultempl/beos.em | 3 | ||||
-rw-r--r-- | ld/emultempl/elf.em | 3 | ||||
-rw-r--r-- | ld/emultempl/generic.em | 3 | ||||
-rw-r--r-- | ld/emultempl/linux.em | 3 | ||||
-rw-r--r-- | ld/emultempl/msp430.em | 3 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 3 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 3 | ||||
-rw-r--r-- | ld/emultempl/ticoff.em | 3 | ||||
-rw-r--r-- | ld/emultempl/vanilla.em | 3 |
11 files changed, 52 insertions, 11 deletions
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 5b73c3e..de313e1 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -1534,6 +1534,36 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch, return TRUE; } +static bfd_boolean +gld${EMULATION_NAME}_print_symbol (struct bfd_link_hash_entry *hash_entry, + void *ptr) +{ + asection *sec = (asection *) ptr; + + if ((hash_entry->type == bfd_link_hash_defined + || hash_entry->type == bfd_link_hash_defweak) + && sec == hash_entry->u.def.section) + { + int i; + struct xcoff_link_hash_entry *h; + + for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) + print_space (); + minfo ("0x%V ", + (hash_entry->u.def.value + + hash_entry->u.def.section->output_offset + + hash_entry->u.def.section->output_section->vma)); + + /* Flag symbol if it has been garbage collected. */ + h = (struct xcoff_link_hash_entry *) hash_entry; + if ((h != NULL) && !(h->flags & XCOFF_MARK)) + minfo (" -->gc"); + minfo (" %pT\n", hash_entry->root.string); + } + + return TRUE; +} + struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { gld${EMULATION_NAME}_before_parse, syslib_default, @@ -1564,6 +1594,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { NULL, /* new_vers_pattern */ NULL, /* extra_map_file_text */ ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + gld${EMULATION_NAME}_print_symbol }; EOF diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em index c539e2f..ff22af4 100644 --- a/ld/emultempl/armcoff.em +++ b/ld/emultempl/armcoff.em @@ -286,6 +286,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = NULL, /* new_vers_pattern */ NULL, /* extra_map_file_text */ ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index 2c3e5e5..442ff12 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -786,6 +786,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = NULL, /* new_vers_pattern */ NULL, /* extra_map_file_text */ ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em index 8990300..eac2ce2 100644 --- a/ld/emultempl/elf.em +++ b/ld/emultempl/elf.em @@ -903,6 +903,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = ${LDEMUL_NEW_VERS_PATTERN-NULL}, ${LDEMUL_EXTRA_MAP_FILE_TEXT-NULL}, ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em index a39c933..24d3c1d 100644 --- a/ld/emultempl/generic.em +++ b/ld/emultempl/generic.em @@ -161,6 +161,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = ${LDEMUL_NEW_VERS_PATTERN-NULL}, ${LDEMUL_EXTRA_MAP_FILE_TEXT-NULL}, ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index f4ae6cf..e9d802c 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.em @@ -213,6 +213,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = NULL, /* new_vers_pattern */ NULL, /* extra_map_file_text */ ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF diff --git a/ld/emultempl/msp430.em b/ld/emultempl/msp430.em index 861c1dc..850c3a8 100644 --- a/ld/emultempl/msp430.em +++ b/ld/emultempl/msp430.em @@ -848,7 +848,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = ${LDEMUL_NEW_VERS_PATTERN-NULL}, ${LDEMUL_EXTRA_MAP_FILE_TEXT-NULL}, ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF # diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index ad5d65d..3dd36de 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -2394,6 +2394,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = NULL, /* new_vers_pattern. */ NULL, /* extra_map_file_text. */ ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index aa8bac5..39ddd8f 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -2192,6 +2192,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = NULL, /* new_vers_pattern. */ NULL, /* extra_map_file_text */ ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em index 60c0da9..11ddd0c 100644 --- a/ld/emultempl/ticoff.em +++ b/ld/emultempl/ticoff.em @@ -186,6 +186,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = NULL, /* new_vers_pattern */ NULL, /* extra_map_file_text */ ${LDEMUL_EMIT_CTF_EARLY-NULL}, - ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL} + ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}, + ${LDEMUL_PRINT_SYMBOL-NULL} }; EOF diff --git a/ld/emultempl/vanilla.em b/ld/emultempl/vanilla.em index ae6f6e4..70d193c 100644 --- a/ld/emultempl/vanilla.em +++ b/ld/emultempl/vanilla.em @@ -87,6 +87,7 @@ struct ld_emulation_xfer_struct ld_vanilla_emulation = NULL, /* new_vers_pattern */ NULL, /* extra_map_file_text */ NULL, /* emit_ctf_early */ - NULL /* examine_strtab_for_ctf */ + NULL, /* examine_strtab_for_ctf */ + NULL /* print_symbol */ }; EOF |