Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9149ccfa authored by Peter Bergner's avatar Peter Bergner Committed by Linus Torvalds
Browse files

[PATCH] ppc64: Add R_PPC64_TOC16 module reloc



Newer gcc's are generating this relocation, so the module loader needs to
handle it.

Signed-off-by: default avatarPeter Bergner <bergner@vnet.ibm.com>
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d3089792
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -341,6 +341,19 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
			*(unsigned long *)location = my_r2(sechdrs, me);
			*(unsigned long *)location = my_r2(sechdrs, me);
			break;
			break;


		case R_PPC64_TOC16:
			/* Subtact TOC pointer */
			value -= my_r2(sechdrs, me);
			if (value + 0x8000 > 0xffff) {
				printk("%s: bad TOC16 relocation (%lu)\n",
				       me->name, value);
				return -ENOEXEC;
			}
			*((uint16_t *) location)
				= (*((uint16_t *) location) & ~0xffff)
				| (value & 0xffff);
			break;

		case R_PPC64_TOC16_DS:
		case R_PPC64_TOC16_DS:
			/* Subtact TOC pointer */
			/* Subtact TOC pointer */
			value -= my_r2(sechdrs, me);
			value -= my_r2(sechdrs, me);