generic/3.10: remove unused defines from the rootfs split patch
[openwrt.git] / target / linux / generic / patches-3.10 / 305-mips_module_reloc.patch
index 5d2f1e25211559b119b1ed35c0572db43e165d6d..d8cd0e59cf3dc6eab9b8295ef63ed5c7b18a3d79 100644 (file)
@@ -30,7 +30,7 @@
  typedef uint8_t Elf64_Byte;           /* Type for a 8-bit quantity.  */
 --- a/arch/mips/kernel/module.c
 +++ b/arch/mips/kernel/module.c
-@@ -42,14 +42,219 @@ struct mips_hi16 {
+@@ -42,14 +42,222 @@ struct mips_hi16 {
  static LIST_HEAD(dbe_list);
  static DEFINE_SPINLOCK(dbe_lock);
  
 +      unsigned int core_size, init_size;
 +      int i;
 +
++      mod->arch.phys_plt_offset = 0;
++      mod->arch.virt_plt_offset = 0;
++      mod->arch.phys_plt_tbl = NULL;
++      mod->arch.virt_plt_tbl = NULL;
++
++      if (IS_ENABLED(CONFIG_64BIT))
++              return 0;
++
 +      for (i = 1; i < hdr->e_shnum; i++)
 +              if (sechdrs[i].sh_type == SHT_SYMTAB)
 +                      symindex = i;
 +      core_size = get_plt_size(hdr, sechdrs, secstrings, symindex, false);
 +      init_size = get_plt_size(hdr, sechdrs, secstrings, symindex, true);
 +
-+      mod->arch.phys_plt_offset = 0;
-+      mod->arch.virt_plt_offset = 0;
-+      mod->arch.phys_plt_tbl = NULL;
-+      mod->arch.virt_plt_tbl = NULL;
-+
 +      if ((core_size + init_size) == 0)
 +              return 0;
 +
  
  int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v)
  {
-@@ -63,8 +268,39 @@ static int apply_r_mips_32_rel(struct mo
+@@ -63,8 +271,39 @@ static int apply_r_mips_32_rel(struct mo
        return 0;
  }
  
        if (v % 4) {
                pr_err("module %s: dangerous R_MIPS_26 REL relocation\n",
                       me->name);
-@@ -72,14 +308,17 @@ static int apply_r_mips_26_rel(struct mo
+@@ -72,14 +311,17 @@ static int apply_r_mips_26_rel(struct mo
        }
  
        if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
  
        return 0;
  }
-@@ -286,11 +525,32 @@ int module_finalize(const Elf_Ehdr *hdr,
+@@ -286,11 +528,32 @@ int module_finalize(const Elf_Ehdr *hdr,
                list_add(&me->arch.dbe_list, &dbe_list);
                spin_unlock_irq(&dbe_lock);
        }