aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2003-01-17 23:27:57 +0000
committerJakub Jelinek <jakub@redhat.com>2003-01-17 23:27:57 +0000
commita823975ae077d7977f892c6ae43cdce7ecc75537 (patch)
treeaaf81987ca50070ffa5a1c43b05b2f66719c34d7 /bfd/elfxx-ia64.c
parent0bcc87e7c5b5b8849718f747817a265d59cb1fa5 (diff)
downloadgdb-a823975ae077d7977f892c6ae43cdce7ecc75537.zip
gdb-a823975ae077d7977f892c6ae43cdce7ecc75537.tar.gz
gdb-a823975ae077d7977f892c6ae43cdce7ecc75537.tar.bz2
* elfxx-ia64.c (elfNN_ia64_relocate_section): Handle
R_IA64_TPREL64[LM]SB against non-global symbol properly. * ld-ia64/tlspic1.s: Add tests for IE in shared libraries. * ld-ia64/tlspic.rd: Adjust. * ld-ia64/tlspic.dd: Adjust. * ld-ia64/tlspic.sd: Adjust.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 2a32591..7097de0 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -4264,13 +4264,23 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
case R_IA64_LTOFF_DTPREL22:
{
int got_r_type;
+ long dynindx = h ? h->dynindx : -1;
+ bfd_vma r_addend = rel->r_addend;
switch (r_type)
{
default:
case R_IA64_LTOFF_TPREL22:
- if (!dynamic_symbol_p && !info->shared)
- value -= elfNN_ia64_tprel_base (info);
+ if (!dynamic_symbol_p)
+ {
+ if (!info->shared)
+ value -= elfNN_ia64_tprel_base (info);
+ else
+ {
+ r_addend += value - elfNN_ia64_dtprel_base (info);
+ dynindx = 0;
+ }
+ }
got_r_type = R_IA64_TPREL64LSB;
break;
case R_IA64_LTOFF_DTPMOD22:
@@ -4285,8 +4295,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
- value = set_got_entry (input_bfd, info, dyn_i,
- (h ? h->dynindx : -1), rel->r_addend,
+ value = set_got_entry (input_bfd, info, dyn_i, dynindx, r_addend,
value, got_r_type);
value -= gp_val;
r = elfNN_ia64_install_value (output_bfd, hit_addr, value,