This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 1/1] aarch64:fix aarch64_tlsdesc conflict handling
- From: Maninder Singh <maninder1 dot s at samsung dot com>
- To: libc-alpha at sourceware dot org, marcus dot shawcroft at arm dot com
- Cc: mark dot hatle at windriver dot com, ajeet dot y at samsung dot com, hakbong5 dot lee at samsung dot com, doha dot hwang at samsung dot com, pankaj dot m at samsung dot com, Maninder Singh <maninder1 dot s at samsung dot com>, Vaneet Narang <v dot narang at samsung dot com>
- Date: Fri, 06 Nov 2015 12:29:11 +0530
- Subject: [PATCH 1/1] aarch64:fix aarch64_tlsdesc conflict handling
- Authentication-results: sourceware.org; auth=none
- Dlp-filter: Pass
This patch fixes aarch64_tlsdesc conflict handling in
.gnu.conflict section. This patch is added to support prelink
on aarch64 architecture.
http://git.yoctoproject.org/cgit/cgit.cgi/prelink-cross/commit
/?h=cross_prelink_aarch64&id=2e83ded69171d87b76bcffaeffbd2cdb532663de
Signed-off-by: Vaneet Narang <v.narang@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
---
sysdeps/aarch64/dl-machine.h | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
index 217e179..70c112d 100644
--- a/sysdeps/aarch64/dl-machine.h
+++ b/sysdeps/aarch64/dl-machine.h
@@ -290,9 +290,20 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
#ifndef RTLD_BOOTSTRAP
if (! sym)
{
- td->arg = (void*)reloc->r_addend;
- td->entry = _dl_tlsdesc_undefweak;
- }
+ ElfW(Rela) * conflict_start = NULL;
+ ElfW(Rela) * conflict_end = NULL;
+ if ( l->l_info [ADDRIDX (DT_GNU_CONFLICT)])
+ {
+ conflict_start = (ElfW(Rela) *) map->l_info [ADDRIDX (DT_GNU_CONFLICT)]->d_un.d_ptr;
+ conflict_end = conflict_start +
+ map->l_info [VALIDX (DT_GNU_CONFLICTSZ)]->d_un.d_val;
+ }
+ td->arg = (void*)reloc->r_addend;
+ if(conflict_start <= reloc && conflict_end >= reloc)
+ td->entry = _dl_tlsdesc_return;
+ else
+ td->entry = _dl_tlsdesc_undefweak;
+ }
else
#endif
{
--
1.7.1