public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* What types of relocations needed to be saved in the option "-emit-relocs" in ld linker?
@ 2021-11-03 11:02 罗海玲
  2021-11-05  6:31 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: 罗海玲 @ 2021-11-03 11:02 UTC (permalink / raw)
  To: binutils

Hi all,
    I’m new of ld linker. And I have a simple problem about ld linker. 
What types of relocations needed to be saved in the option "-emit-relocs” 
in ld linker? Do all types of relocations need to be saved?

Thanks.

Best regards,
Luo


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

* Re: What types of relocations needed to be saved in the option "-emit-relocs" in ld linker?
  2021-11-03 11:02 What types of relocations needed to be saved in the option "-emit-relocs" in ld linker? 罗海玲
@ 2021-11-05  6:31 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2021-11-05  6:31 UTC (permalink / raw)
  To: 罗海玲; +Cc: binutils

On Wed, Nov 03, 2021 at 07:02:34PM +0800, 罗海玲 via Binutils wrote:
> Hi all,
>     I’m new of ld linker. And I have a simple problem about ld linker. 
> What types of relocations needed to be saved in the option "-emit-relocs” 
> in ld linker? Do all types of relocations need to be saved?

--emit-relocs is mostly handled by the generic code.  See
elflink.c:elf_link_input_bfd after the call to relocate_section, which
will copy all relocs from input to output.  Some will be zeroed out.
Where a backend edits code in some way it may be necessary to edit
relocations too, in order for the output relocations to match up with
the code.

-- 
Alan Modra
Australia Development Lab, IBM

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

end of thread, other threads:[~2021-11-05  6:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 11:02 What types of relocations needed to be saved in the option "-emit-relocs" in ld linker? 罗海玲
2021-11-05  6:31 ` 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).