Page MenuHomeFreeBSD

D8177.id21151.diff
No OneTemporary

D8177.id21151.diff

Index: head/sys/boot/common/self_reloc.c
===================================================================
--- head/sys/boot/common/self_reloc.c
+++ head/sys/boot/common/self_reloc.c
@@ -108,12 +108,18 @@
break;
case RELOC_TYPE_RELATIVE:
- /* Address relative to the base address. */
newaddr = (Elf_Addr *)(rel->r_offset + baseaddr);
- *newaddr += baseaddr;
- /* Add the addend when the ABI uses them */
#ifdef ELF_RELA
- *newaddr += rel->r_addend;
+ /*
+ * For R_AARCH64_RELATIVE we need to calculate the
+ * delta between the address we are run from and the
+ * address we are linked at. As the latter is 0 we
+ * just use the address we are run from for this.
+ */
+ *newaddr = baseaddr + rel->r_addend;
+#else
+ /* Address relative to the base address. */
+ *newaddr += baseaddr;
#endif
break;
default:

File Metadata

Mime Type
text/plain
Expires
Mon, Sep 28, 11:06 PM (19 m, 2 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39833889
Default Alt Text
D8177.id21151.diff (863 B)

Event Timeline