mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master v2 0/3] Fix GCC 11 THUMB2 relocate_to_current_adr miscompile
@ 2022-10-20 13:15 Ahmad Fatoum
  2022-10-20 13:15 ` [PATCH master v2 1/3] include: asm-generic: reloc: implement runtime_address() Ahmad Fatoum
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2022-10-20 13:15 UTC (permalink / raw)
  To: barebox

Since a8b788ba61eb ("relocate_to_current_adr: hang directly on error instead
of panic()"),  GCC can prove that variables aren't supposed to overlap and as
such it generated code than readded get_runtime_offset() on top of an
already relocated linker-defined variable's address.
See PATCH 2/3 for a disassembly of the affected code. Board code can
be similarly micompiled, but that's a fix for another day.

Ahmad Fatoum (3):
  include: asm-generic: reloc: implement runtime_address()
  ARM: cpu: add compiler barrier around unrelocated access
  RISC-V: add compiler barriers around unrelocated accesses

 arch/arm/cpu/common.c             | 15 ++++---
 arch/arm/cpu/uncompress.c         |  4 +-
 arch/riscv/boot/uncompress.c      |  4 +-
 arch/riscv/include/asm/sections.h |  3 +-
 arch/riscv/lib/reloc.c            | 10 +++--
 include/asm-generic/reloc.h       | 69 +++++++++++++++++++++++++++++++
 6 files changed, 91 insertions(+), 14 deletions(-)

-- 
2.30.2




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

end of thread, other threads:[~2022-10-24  9:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 13:15 [PATCH master v2 0/3] Fix GCC 11 THUMB2 relocate_to_current_adr miscompile Ahmad Fatoum
2022-10-20 13:15 ` [PATCH master v2 1/3] include: asm-generic: reloc: implement runtime_address() Ahmad Fatoum
2022-10-20 13:15 ` [PATCH master v2 2/3] ARM: cpu: add compiler barrier around unrelocated access Ahmad Fatoum
2022-10-20 13:15 ` [PATCH v2 3/3] RISC-V: add compiler barriers around unrelocated accesses Ahmad Fatoum
2022-10-21  5:34 ` [PATCH master v2 0/3] Fix GCC 11 THUMB2 relocate_to_current_adr miscompile Ahmad Fatoum
2022-10-24  9:03 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox