From 13beb5e336002c314d36f729b5aea4bb181e2a23 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Fri, 10 Feb 2017 11:59:34 -0500 Subject: [PATCH] Document RELOLIS from commit 1bf58cf. I hastily chose the name RELOLIS for this relocation type. If we want to rename it, we only need to edit these files: - h/out.h - mach/powerpc/as/mach5.c - util/amisc/ashow.c - util/led/ack.out.5 - util/led/relocate.c --- util/led/ack.out.5 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/util/led/ack.out.5 b/util/led/ack.out.5 index fa997e8ca..c8b9fc8fa 100644 --- a/util/led/ack.out.5 +++ b/util/led/ack.out.5 @@ -161,12 +161,13 @@ struct outrelo { /* * relocation type bits */ -#define RELSZ 0x0fff /* relocation length */ +#define RELSZ 0x0fff /* relocation length */ #define RELO1 0x01 /* 1 byte */ #define RELO2 0x02 /* 2 bytes */ #define RELO4 0x03 /* 4 bytes */ #define RELOPPC 0x04 /* 26-bit PowerPC address */ -#define RELOVC4 0x06 /* VideoCore IV address in 32-bit insruction */ +#define RELOLIS 0x05 /* PowerPC lis */ +#define RELOVC4 0x06 /* VideoCore IV address in 32-bit insruction */ #define RELPC 0x2000 /* pc relative */ #define RELBR 0x4000 /* High order byte lowest address. */ #define RELWR 0x8000 /* High order word lowest address. */ @@ -225,10 +226,23 @@ is an absolute number, and the datum is relocated pc relative. The relocatable datum must then be relocated with respect to the base address of its section. .PP +For RELOPPC and RELOVC4, the relocatable datum is a PowerPC or +VideoCore IV instruction. +The relocation depends on the instruction, and uses an offset encoded +in the instruction. +.PP +RELOLIS assembles a PowerPC \fBlis\fR instruction. +The relocatable datum is a 4-byte integer. +The high bit is set for ha16 or clear for hi16. +The next 5 bits are the register \fIRT\fR. +The low 26 bits are a signed offset. +The relocation replaces the datum with the PowerPC instruction +\(oq\fBlis\fR\ \fIRT\fR,\ ha16[\fIsymbol\fR\ +\ \fIoffset\fR]\(cq. +.PP .B The symbol table. .br -This table contains definitions of symbols. It is referred to by -outrelo-structures, and can be used by debuggers. +This table contains definitions of symbols. +It is referred to by outrelo-structures, and can be used by debuggers. Entries in this table have the following structure: .PP .nf