public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Fix several mix up between octets and bytes in ELF program headers
@ 2020-02-15 19:37 Christian Eggers
  2020-02-16  8:22 ` Christian Eggers
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Eggers @ 2020-02-15 19:37 UTC (permalink / raw)
  To: binutils; +Cc: amodra

forgot the subject in my first mail....

On Wed, 18 Dec 2019 12:42:57 +1030, Alan Modra wrote:
> Overall this is looking good, and I think your decision to make the
> internal units for p_vaddr, p_paddr and sh_addr octets has worked out
> well.

Sorry for responding late. I do the binutils SDMA port in my leisure
time. In the last two months I had to focus on my primary work and on my
family. I hope that upstreaming of my SDMA work can be finished soon.

> But it looks like you have missed a few places that need an octet per
> byte factor...
In order to ease review for you, I did only slight changes on the v2
patch and added the missing parts in a follow-up patch.

> ...eg. elf.c search for filehdr_vaddr.  Symbol values for
> an address are in bytes, at least internally.
added in the follow-up.

> There's another one at
> around line 7190 of elf.c where we have a comparison of an expression
> involving p_vaddr and a section vma.
also added in the follow-up.

> That one raises the question of
> what to do with alignment.  Presumably, section->alignment_power stays
> in bytes since it is most often used with section->vma.
I added a comment on the struct member in the follow-up patch.

> So that's
> another thing that needs converting if used to align p_vaddr/p_paddr.
In the follow-up, I also checked all users of section->alignment_power.

> Also elfcode.h bfd_from_remote_memory uses p_vaddr without converting
> to bytes.
done in the follow-up.

> Also search for phdr_lma in elf.c.
done in the follow-up.

> IS_CONTAINED_BY_LMA needs a fix too,
changed in v3 of the first patch

> and this in elf.c "map->p_paddr = matching_lma->lma"
done in the follow-up

> and the alignment a little later.
unsure, maybe I didn't find

> You also need to correct code in bfd_elf_final_link using sh_addr when
> setting up DT_REL/DT_RELA.  There's a comparison between sh_addr and
> vma.
done in the follow-up

> The following in elf32-rx.c where octets per byte is always one (and
> thus the file needs no change) is bogus, please remove, and the change
> to elf64-ia64-vms.c too:
removed in v3 of the first patch

regards
Christian



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

end of thread, other threads:[~2020-03-07 21:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-15 19:37 [PATCH v3 0/2] Fix several mix up between octets and bytes in ELF program headers Christian Eggers
2020-02-16  8:22 ` Christian Eggers
2020-02-16 19:37   ` Christian Eggers
2020-02-20  1:30     ` Alan Modra
2020-02-22 16:32       ` Christian Eggers
2020-02-22 21:08       ` Christian Eggers
2020-02-23  9:07       ` Christian Eggers
2020-02-27  8:35         ` Alan Modra
2020-03-07 21:05           ` Christian Eggers
2020-02-23 18:35       ` Christian Eggers

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