Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322245
b: refs/heads/master
c: 861667d
h: refs/heads/master
i:
  322243: 8d6e201
v: v3
  • Loading branch information
Ralf Baechle committed Aug 17, 2012
1 parent 0328125 commit 66f7b9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3cac35cd0a2a987f7559e1829fb0253cea33872
refs/heads/master: 861667dc82f561e65336ea67f73021b782b4ff74
1 change: 1 addition & 0 deletions trunk/arch/mips/include/asm/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct mod_arch_specific {
struct list_head dbe_list;
const struct exception_table_entry *dbe_start;
const struct exception_table_entry *dbe_end;
struct mips_hi16 *r_mips_hi16_list;
};

typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */
Expand Down
13 changes: 6 additions & 7 deletions trunk/arch/mips/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ struct mips_hi16 {
Elf_Addr value;
};

static struct mips_hi16 *mips_hi16_list;

static LIST_HEAD(dbe_list);
static DEFINE_SPINLOCK(dbe_lock);

Expand Down Expand Up @@ -128,8 +126,8 @@ static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)

n->addr = (Elf_Addr *)location;
n->value = v;
n->next = mips_hi16_list;
mips_hi16_list = n;
n->next = me->arch.r_mips_hi16_list;
me->arch.r_mips_hi16_list = n;

return 0;
}
Expand All @@ -151,9 +149,9 @@ static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
/* Sign extend the addend we extract from the lo insn. */
vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;

if (mips_hi16_list != NULL) {
if (me->arch.r_mips_hi16_list != NULL) {

l = mips_hi16_list;
l = me->arch.r_mips_hi16_list;
while (l != NULL) {
unsigned long insn;

Expand Down Expand Up @@ -187,7 +185,7 @@ static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
l = next;
}

mips_hi16_list = NULL;
me->arch.r_mips_hi16_list = NULL;
}

/*
Expand Down Expand Up @@ -278,6 +276,7 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
pr_debug("Applying relocate section %u to %u\n", relsec,
sechdrs[relsec].sh_info);

me->arch.r_mips_hi16_list = NULL;
for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
/* This is where to make the change */
location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
Expand Down

0 comments on commit 66f7b9f

Please sign in to comment.