mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-06 07:33:08 +00:00
Fix objdump --reloc for specific symbol
If objdump is used with both --disassemble=symbol and --reloc options skip relocations that have addresses before the symbol, so that they are not displayed.
This commit is contained in:
committed by
Alan Modra
parent
eb8f8bbb11
commit
7e538762c2
@@ -3910,6 +3910,13 @@ disassemble_section (bfd *abfd, asection *section, void *inf)
|
|||||||
{
|
{
|
||||||
do_print = true;
|
do_print = true;
|
||||||
|
|
||||||
|
/* Skip over the relocs belonging to addresses below the
|
||||||
|
symbol address. */
|
||||||
|
const bfd_vma sym_offset = bfd_asymbol_value (sym) - section->vma;
|
||||||
|
while (rel_pp < rel_ppend &&
|
||||||
|
(*rel_pp)->address - rel_offset < sym_offset)
|
||||||
|
++rel_pp;
|
||||||
|
|
||||||
if (sym->flags & BSF_FUNCTION)
|
if (sym->flags & BSF_FUNCTION)
|
||||||
{
|
{
|
||||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
|
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
|
||||||
|
|||||||
Reference in New Issue
Block a user