From 8fe33f64065f3f0ff768153e403ab46a5ac013ab Mon Sep 17 00:00:00 2001 From: hp Date: Mon, 19 Oct 2009 16:33:49 +0000 Subject: [PATCH] * elf32-cris.c (cris_elf_relocate_section) : Don't subtract the size of the TLS block for non-shared objects from the relocation. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-cris.c | 11 +++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f6b03d95f1..bc8fc7c94f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2009-10-19 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : + Don't subtract the size of the TLS block for non-shared objects + from the relocation. + 2009-10-17 Arnold Metselaar * coff-z80.c (z80coff_vec): Allow sections to be of type diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 2037b10f59..ceea1b9273 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -1690,15 +1690,10 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, = -elf_cris_hash_table (info)->dtpmod_refcount; } - /* The thread-based offset to the local symbol is the - relocation. - For the executable, TLS data begins at the thread pointer plus - the negative size of the TLS data. For a DSO, that's part of - the module TLS offset. */ + /* The relocation is the offset from the start of the module + TLS block to the (local) symbol. */ relocation -= elf_hash_table (info)->tls_sec == NULL - ? 0 : (elf_hash_table (info)->tls_sec->vma - + (info->shared - ? 0 : elf_hash_table (info)->tls_size)); + ? 0 : elf_hash_table (info)->tls_sec->vma; break; case R_CRIS_32_GD: -- 2.11.0