public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Misleading names
@ 2023-09-03 21:59 jacob navia
  2023-09-04  0:04 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: jacob navia @ 2023-09-03 21:59 UTC (permalink / raw)
  To: binutils

Hi
The function riscv_elf_ignore_reloc, contrary to its name, does NOT ignore the relocation!

/* Special handler for relocations which don't have to be relocated. This
 * function just simply return bfd_reloc_ok.  */
static bfd_reloc_status_type riscv_elf_ignore_reloc(bfd * abfd ATTRIBUTE_UNUSED,
                            arelent *   reloc_entry,
                    asymbol *   symbol ATTRIBUTE_UNUSED,
                        void         *data ATTRIBUTE_UNUSED,
                            asection *  input_section,
                            bfd *       output_bfd,
                    char        **error_message ATTRIBUTE_UNUSED)
{
    if (output_bfd != NULL) 
        reloc_entry->address += input_section->output_offset;
    return bfd_reloc_ok;
}

Despite its name, and the associated comment, nothing is ignored here and the relocation address is modified.

Long, descriptive names are very good WHEN THEY REFLECT THE TRUTH!
Otherwise they are completely misleading.

Of course this is not a bug. 

FILE: elfe-riscv.c 
LINE:  1053

Jacob

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-04 23:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-03 21:59 Misleading names jacob navia
2023-09-04  0:04 ` Alan Modra
2023-09-04  6:29   ` jacob navia
2023-09-04 23:54     ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).