Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173722343
D8177.id21151.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
863 B
Referenced Files
None
Subscribers
None
D8177.id21151.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D8177: Fix bootloader relocations on arm64
Attached
Detach File
Event Timeline
Log In to Comment