summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/0028-Backport-from-mainline.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/0028-Backport-from-mainline.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/0028-Backport-from-mainline.patch139
1 files changed, 139 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/0028-Backport-from-mainline.patch b/meta/recipes-devtools/binutils/binutils/0028-Backport-from-mainline.patch
new file mode 100644
index 0000000000..2b86b6bf3b
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0028-Backport-from-mainline.patch
@@ -0,0 +1,139 @@
1Upstream-Status: Backport
2
3From fbd07e4e15de7a81a2de7f9583fa3240302e2867 Mon Sep 17 00:00:00 2001
4From: David Daney <ddaney@avtrex.com>
5Date: Sun, 11 Dec 2011 02:28:10 +0000
6Subject: [PATCH 028/262] Backport from mainline:
7
8 2011-12-10 David Daney <david.daney@cavium.com>
9
10 * elfxx-mips.c (mips_elf_link_hash_table.rld_value): Remove.
11 (mips_elf_link_hash_table.rld_symbol): New field;
12 (MIPS_ELF_RLD_MAP_SIZE): New macro.
13 (_bfd_mips_elf_add_symbol_hook): Remember __rld_obj_head symbol
14 in rld_symbol.
15 (_bfd_mips_elf_create_dynamic_sections): Remember __rld_map symbol
16 in rld_symbol.
17 (_bfd_mips_elf_size_dynamic_sections): Set correct size for .rld_map.
18 (_bfd_mips_elf_finish_dynamic_symbol): Remove .rld_map handling.
19 (_bfd_mips_elf_finish_dynamic_sections): Use rld_symbol to
20 calculate DT_MIPS_RLD_MAP value.
21 (_bfd_mips_elf_link_hash_table_create): Initialize rld_symbol,
22 quit initializing rld_value.
23
24diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
25index 33a454d..6b908ad 100644
26--- a/bfd/elfxx-mips.c
27+++ b/bfd/elfxx-mips.c
28@@ -436,8 +436,8 @@ struct mips_elf_link_hash_table
29 entry is set to the address of __rld_obj_head as in IRIX5. */
30 bfd_boolean use_rld_obj_head;
31
32- /* This is the value of the __rld_map or __rld_obj_head symbol. */
33- bfd_vma rld_value;
34+ /* The __rld_map or __rld_obj_head symbol. */
35+ struct elf_link_hash_entry *rld_symbol;
36
37 /* This is set if we see any mips16 stub sections. */
38 bfd_boolean mips16_stubs_seen;
39@@ -768,6 +768,10 @@ static bfd *reldyn_sorting_bfd;
40 #define MIPS_ELF_GOT_SIZE(abfd) \
41 (get_elf_backend_data (abfd)->s->arch_size / 8)
42
43+/* The size of the .rld_map section. */
44+#define MIPS_ELF_RLD_MAP_SIZE(abfd) \
45+ (get_elf_backend_data (abfd)->s->arch_size / 8)
46+
47 /* The size of a symbol-table entry. */
48 #define MIPS_ELF_SYM_SIZE(abfd) \
49 (get_elf_backend_data (abfd)->s->sizeof_sym)
50@@ -7081,6 +7085,7 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
51 return FALSE;
52
53 mips_elf_hash_table (info)->use_rld_obj_head = TRUE;
54+ mips_elf_hash_table (info)->rld_symbol = h;
55 }
56
57 /* If this is a mips16 text symbol, add 1 to the value to make it
58@@ -7266,6 +7271,7 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
59
60 if (! bfd_elf_link_record_dynamic_symbol (info, h))
61 return FALSE;
62+ mips_elf_hash_table (info)->rld_symbol = h;
63 }
64 }
65
66@@ -9027,7 +9033,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
67 {
68 /* We add a room for __rld_map. It will be filled in by the
69 rtld to contain a pointer to the _r_debug structure. */
70- s->size += 4;
71+ s->size += MIPS_ELF_RLD_MAP_SIZE (output_bfd);
72 }
73 else if (SGI_COMPAT (output_bfd)
74 && CONST_STRNEQ (name, ".compact_rel"))
75@@ -10030,31 +10036,6 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
76 if (IRIX_COMPAT (output_bfd) == ict_irix6)
77 mips_elf_irix6_finish_dynamic_symbol (output_bfd, name, sym);
78
79- if (! info->shared)
80- {
81- if (! mips_elf_hash_table (info)->use_rld_obj_head
82- && (strcmp (name, "__rld_map") == 0
83- || strcmp (name, "__RLD_MAP") == 0))
84- {
85- asection *s = bfd_get_section_by_name (dynobj, ".rld_map");
86- BFD_ASSERT (s != NULL);
87- sym->st_value = s->output_section->vma + s->output_offset;
88- bfd_put_32 (output_bfd, 0, s->contents);
89- if (mips_elf_hash_table (info)->rld_value == 0)
90- mips_elf_hash_table (info)->rld_value = sym->st_value;
91- }
92- else if (mips_elf_hash_table (info)->use_rld_obj_head
93- && strcmp (name, "__rld_obj_head") == 0)
94- {
95- /* IRIX6 does not use a .rld_map section. */
96- if (IRIX_COMPAT (output_bfd) == ict_irix5
97- || IRIX_COMPAT (output_bfd) == ict_none)
98- BFD_ASSERT (bfd_get_section_by_name (dynobj, ".rld_map")
99- != NULL);
100- mips_elf_hash_table (info)->rld_value = sym->st_value;
101- }
102- }
103-
104 /* Keep dynamic MIPS16 symbols odd. This allows the dynamic linker to
105 treat MIPS16 symbols like any other. */
106 if (ELF_ST_IS_MIPS16 (sym->st_other))
107@@ -10517,7 +10498,19 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
108 break;
109
110 case DT_MIPS_RLD_MAP:
111- dyn.d_un.d_ptr = mips_elf_hash_table (info)->rld_value;
112+ {
113+ struct elf_link_hash_entry *h;
114+ h = mips_elf_hash_table (info)->rld_symbol;
115+ if (!h)
116+ {
117+ dyn_to_skip = MIPS_ELF_DYN_SIZE (dynobj);
118+ swap_out_p = FALSE;
119+ break;
120+ }
121+ s = h->root.u.def.section;
122+ dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset
123+ + h->root.u.def.value);
124+ }
125 break;
126
127 case DT_MIPS_OPTIONS:
128@@ -12794,7 +12787,7 @@ _bfd_mips_elf_link_hash_table_create (bfd *abfd)
129 ret->procedure_count = 0;
130 ret->compact_rel_size = 0;
131 ret->use_rld_obj_head = FALSE;
132- ret->rld_value = 0;
133+ ret->rld_symbol = NULL;
134 ret->mips16_stubs_seen = FALSE;
135 ret->use_plts_and_copy_relocs = FALSE;
136 ret->is_vxworks = FALSE;
137--
1381.7.9.5
139