Thread (42 messages) 42 messages, 4 authors, 2014-04-22

Re: [PATCH 27/33] powerpc: Handle new ELFv2 module relocations

From: Alan Modra <hidden>
Date: 2014-03-26 10:28:54

On Tue, Mar 25, 2014 at 10:44:33PM +1100, Anton Blanchard wrote:
From: Rusty Russell <redacted>
+		case R_PPC64_REL16_HA:
+			/* Subtract location pointer */
+			value -= (unsigned long)location;
+			value = ((value + 0x8000) >> 16);
+			*((uint16_t *) location)
+				= (*((uint16_t *) location) & ~0xffff)
+				| (value & 0xffff);
There's not much point reading the uint16_t.

			*(uint16_t *) location = value;
+			break;
+
+		case R_PPC64_REL16_LO:
+			/* Subtract location pointer */
+			value -= (unsigned long)location;
+			*((uint16_t *) location)
+				= (*((uint16_t *) location) & ~0xffff)
+				| (value & 0xffff);
and again.
+			break;
+
 		default:
 			printk("%s: Unknown ADD relocation: %lu\n",
 			       me->name,
-- 
Alan Modra
Australia Development Lab, IBM
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help