summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/prelink
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-01-14 14:21:02 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-19 13:24:38 +0000
commitc7a903aaa10eadae4ec7f4af3f3fa30763c144fc (patch)
tree41b6424ee9c6f05425a426de89288719b1cd358e /meta/recipes-devtools/prelink
parent83011752a4f10416e04a9a3077f1cb7a06ac3ee0 (diff)
downloadpoky-c7a903aaa10eadae4ec7f4af3f3fa30763c144fc.tar.gz
prelink: Deal with mips specific gnu-hash impelementation
(From OE-Core rev: eae63df5524b681897ff7831fa32f16f1b2f792e) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/prelink')
-rw-r--r--meta/recipes-devtools/prelink/prelink/0001-Add-MIPS-gnu-hash-support.patch110
-rw-r--r--meta/recipes-devtools/prelink/prelink_git.bb1
2 files changed, 111 insertions, 0 deletions
diff --git a/meta/recipes-devtools/prelink/prelink/0001-Add-MIPS-gnu-hash-support.patch b/meta/recipes-devtools/prelink/prelink/0001-Add-MIPS-gnu-hash-support.patch
new file mode 100644
index 0000000000..da0275bfcd
--- /dev/null
+++ b/meta/recipes-devtools/prelink/prelink/0001-Add-MIPS-gnu-hash-support.patch
@@ -0,0 +1,110 @@
1From 05240e13668422c4f9118f2cde953ec875d0d68f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 14 Jan 2020 01:37:22 -0800
4Subject: [PATCH] Add MIPS gnu hash support
5
6Upstream-Status: Pending
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 src/arch-mips.c | 1 +
10 src/prelink.c | 1 +
11 src/prelink.h | 5 +++++
12 3 files changed, 7 insertions(+)
13
14--- a/src/arch-mips.c
15+++ b/src/arch-mips.c
16@@ -324,6 +324,7 @@ mips_adjust_dyn (DSO *dso, int n, GElf_D
17 case DT_MIPS_BASE_ADDRESS:
18 case DT_MIPS_RLD_MAP:
19 case DT_MIPS_OPTIONS:
20+ case DT_MIPS_XHASH:
21 if (dyn->d_un.d_ptr >= start)
22 dyn->d_un.d_ptr += adjust;
23 return 1;
24--- a/src/prelink.c
25+++ b/src/prelink.c
26@@ -425,6 +425,7 @@ prelink_prepare (DSO *dso)
27 {
28 case SHT_HASH:
29 case SHT_GNU_HASH:
30+ case SHT_MIPS_XHASH:
31 case SHT_DYNSYM:
32 case SHT_REL:
33 case SHT_RELA:
34--- a/src/prelink.h
35+++ b/src/prelink.h
36@@ -114,6 +114,11 @@ typedef uint8_t Elf64_Byte;
37 #define SHT_MIPS_ABIFLAGS 0x7000002a
38 #endif
39
40+#ifndef SHT_MIPS_XHASH
41+#define DT_MIPS_XHASH 0x70000036
42+#define SHT_MIPS_XHASH 0x7000002b
43+#endif
44+
45 #ifndef RSS_UNDEF
46 #define RSS_UNDEF 0
47 #endif
48--- a/src/dso.c
49+++ b/src/dso.c
50@@ -109,6 +109,11 @@ read_dynamic (DSO *dso)
51 dso->info_DT_GNU_HASH = dyn.d_un.d_val;
52 dso->info_set_mask |= (1ULL << DT_GNU_HASH_BIT);
53 }
54+ else if (dyn.d_tag == DT_MIPS_XHASH)
55+ {
56+ dso->info_DT_GNU_HASH = dyn.d_un.d_val;
57+ dso->info_set_mask |= (1ULL << DT_GNU_HASH_BIT);
58+ }
59 else if (dyn.d_tag == DT_TLSDESC_PLT)
60 {
61 dso->info_DT_TLSDESC_PLT = dyn.d_un.d_val;
62@@ -1463,6 +1468,7 @@ adjust_dso (DSO *dso, GElf_Addr start, G
63 break;
64 case SHT_HASH:
65 case SHT_GNU_HASH:
66+ case SHT_MIPS_XHASH:
67 case SHT_NOBITS:
68 case SHT_STRTAB:
69 break;
70--- a/src/space.c
71+++ b/src/space.c
72@@ -61,6 +61,7 @@ print_sections (DSO *dso, GElf_Ehdr *ehd
73 { SHT_GNU_versym, "VERSYM" },
74 { SHT_GNU_LIBLIST, "LIBLIST" },
75 { SHT_GNU_HASH, "GNU_HASH" },
76+ { SHT_MIPS_XHASH, "MIPS_XHASH" },
77 { 0, NULL }
78 };
79
80@@ -183,6 +184,7 @@ readonly_is_movable (DSO *dso, GElf_Ehdr
81 {
82 case SHT_HASH:
83 case SHT_GNU_HASH:
84+ case SHT_MIPS_XHASH:
85 case SHT_DYNSYM:
86 case SHT_REL:
87 case SHT_RELA:
88@@ -558,6 +560,7 @@ find_readonly_space (DSO *dso, GElf_Shdr
89 {
90 case SHT_HASH:
91 case SHT_GNU_HASH:
92+ case SHT_MIPS_XHASH:
93 case SHT_DYNSYM:
94 case SHT_STRTAB:
95 case SHT_GNU_verdef:
96--- a/src/exec.c
97+++ b/src/exec.c
98@@ -65,7 +65,11 @@ update_dynamic_tags (DSO *dso, GElf_Shdr
99 || (dynamic_info_is_set (dso, DT_GNU_HASH_BIT)
100 && dso->info_DT_GNU_HASH == old_shdr[j].sh_addr
101 && old_shdr[j].sh_type == SHT_GNU_HASH
102- && set_dynamic (dso, DT_GNU_HASH, shdr[i].sh_addr, 1)))
103+ && set_dynamic (dso, DT_GNU_HASH, shdr[i].sh_addr, 1))
104+ || (dynamic_info_is_set (dso, DT_GNU_HASH_BIT)
105+ && dso->info_DT_GNU_HASH == old_shdr[j].sh_addr
106+ && old_shdr[j].sh_type == SHT_MIPS_XHASH
107+ && set_dynamic (dso, DT_MIPS_XHASH, shdr[i].sh_addr, 1)))
108 return 1;
109 }
110
diff --git a/meta/recipes-devtools/prelink/prelink_git.bb b/meta/recipes-devtools/prelink/prelink_git.bb
index 674f815dbf..e197af9ee9 100644
--- a/meta/recipes-devtools/prelink/prelink_git.bb
+++ b/meta/recipes-devtools/prelink/prelink_git.bb
@@ -28,6 +28,7 @@ FILES_${PN}-cron = "${sysconfdir}/cron.daily ${sysconfdir}/default"
28PACKAGES =+ "${PN}-cron" 28PACKAGES =+ "${PN}-cron"
29 29
30SRC_URI = "git://git.yoctoproject.org/prelink-cross.git;branch=cross_prelink_staging \ 30SRC_URI = "git://git.yoctoproject.org/prelink-cross.git;branch=cross_prelink_staging \
31 file://0001-Add-MIPS-gnu-hash-support.patch \
31 file://prelink.conf \ 32 file://prelink.conf \
32 file://prelink.cron.daily \ 33 file://prelink.cron.daily \
33 file://prelink.default \ 34 file://prelink.default \