Commit 054852c4 authored by Richard Henderson's avatar Richard Henderson Committed by Linus Torvalds

[PATCH] alpha: fix GP-load symbol linkage

From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>

This skips the GP-loading function prologue (two instructions: 8 bytes)
on BRSGP linkage correctly, fixing an oops on alpha while loading the
aic7xxx driver.
parent ed40244e
...@@ -234,6 +234,10 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, ...@@ -234,6 +234,10 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
value was resolved from somewhere else. */ value was resolved from somewhere else. */
if (sym->st_shndx == SHN_UNDEF) if (sym->st_shndx == SHN_UNDEF)
goto reloc_overflow; goto reloc_overflow;
if ((sym->st_other & STO_ALPHA_STD_GPLOAD) ==
STO_ALPHA_STD_GPLOAD)
/* Omit the prologue. */
value += 8;
/* FALLTHRU */ /* FALLTHRU */
case R_ALPHA_BRADDR: case R_ALPHA_BRADDR:
value -= (u64)location + 4; value -= (u64)location + 4;
......
#ifndef __ASM_ALPHA_ELF_H #ifndef __ASM_ALPHA_ELF_H
#define __ASM_ALPHA_ELF_H #define __ASM_ALPHA_ELF_H
/* Special values for the st_other field in the symbol table. */
#define STO_ALPHA_NOPV 0x80
#define STO_ALPHA_STD_GPLOAD 0x88
/* /*
* Alpha ELF relocation types * Alpha ELF relocation types
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment