From 1bc86aea2807866337def70b2e31cb16fbfd1e8d Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Wed, 7 Jan 2009 03:28:45 +0000 Subject: [PATCH] * elf32-cris.c (cris_elf_relocate_section) : For a symbol defined in the program, the known offset starts at the negative size of the TLS section. : Similar. --- bfd/ChangeLog | 9 +++++++++ bfd/elf32-cris.c | 10 +++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c114076c85e..da237ce608d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2009-01-07 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) + : For a symbol defined in + the program, the known offset starts at the negative size of the + TLS section. + : + Similar. + 2009-01-05 Joel Sherrill * config.bfd: Add lm32-*-rtems*. diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index ea268fc9510..dbc00ba6089 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -1721,8 +1721,9 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma off; /* The symbol is defined in the program, so just write - (1, known_tpoffset) into the GOT. */ + (1, -prog_tls_size+known_tpoffset) into the GOT. */ relocation -= elf_hash_table (info)->tls_sec->vma; + relocation -= elf_hash_table (info)->tls_sec->size; if (h != NULL) { @@ -1872,8 +1873,9 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma off; /* The symbol is defined in the program, so just write - the known_tpoffset into the GOT. */ + the -prog_tls_size+known_tpoffset into the GOT. */ relocation -= elf_hash_table (info)->tls_sec->vma; + relocation -= elf_hash_table (info)->tls_sec->size; if (h != NULL) off = h->got.offset; @@ -2001,7 +2003,9 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* NULL if we had an error. */ relocation -= elf_hash_table (info)->tls_sec == NULL - ? 0 : elf_hash_table (info)->tls_sec->vma; + ? 0 + : (elf_hash_table (info)->tls_sec->vma + + elf_hash_table (info)->tls_sec->size); /* The TLS-relative offset is the relocation. */ break; -- 2.30.2