public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* What size-dependent parts of bfd/elfcode.h are undesirable?
@ 2020-04-09 18:27 Jozef Lawrynowicz
  2020-04-09 18:56 ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Jozef Lawrynowicz @ 2020-04-09 18:27 UTC (permalink / raw)
  To: binutils

There is a comment at the top of bfd/elfcode.h:

> (2)  The code in this file is compiled twice, once in 32-bit mode and
>       once in 64-bit mode.  More of it should be made size-independent
>       and moved into elf.c.
>

If I am adding a new ELF type which has 32 and 64-bit versions and has similar
requirements to relocation entries, is it ok to copy much of the implementation
required to support Elf_External_Rel for my new type? i.e. swap_{in,out}
functions, size-independent mappings of external types
(Elf_External_Rel -> Elf{32,64_External_Rel}) and field accessors
(ELF_R_INFO -> Elf{32,64}_R_INFO).

Is there a new recommended way to do something like this, or is the comment
referring to some other parts of the size-dependent implementation?

Thanks,
Jozef

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

end of thread, other threads:[~2020-04-09 20:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 18:27 What size-dependent parts of bfd/elfcode.h are undesirable? Jozef Lawrynowicz
2020-04-09 18:56 ` H.J. Lu
2020-04-09 20:19   ` Jozef Lawrynowicz

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).