* [committed] TILE-Gx/TILEPro: fix got relocations for merged .got/.got.plt
@ 2012-09-17 10:57 Walter Lee
2012-09-17 13:22 ` Build regression with --enable-targets=all [Re: [committed] TILE-Gx/TILEPro: fix got relocations for merged .got/.got.plt] Jan Kratochvil
0 siblings, 1 reply; 3+ messages in thread
From: Walter Lee @ 2012-09-17 10:57 UTC (permalink / raw)
To: binutils
This patch fixes the computation of got relocations for when .got.plt
section is merged with .got.
Walter
* elf32-tilepro.c (tilepro_elf_relocate_section): Fix computation
of got relocations for when .got.plt section is merged with .got.
* elfxx-tilegx.c (tilegx_elf_relocate_section): Ditto.
Index: bfd/elf32-tilepro.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-tilepro.c,v
retrieving revision 1.12
diff -u -p -r1.12 elf32-tilepro.c
--- bfd/elf32-tilepro.c 2 Sep 2012 12:17:26 -0000 1.12
+++ bfd/elf32-tilepro.c 17 Sep 2012 10:47:58 -0000
@@ -3092,7 +3092,7 @@ tilepro_elf_relocate_section (bfd *outpu
local_got_offsets[r_symndx] |= 1;
}
}
- relocation = htab->elf.sgot->output_offset + off - got_base;
+ relocation = off;
break;
case R_TILEPRO_JOFFLONG_X1_PLT:
@@ -3511,7 +3511,7 @@ tilepro_elf_relocate_section (bfd *outpu
if (off >= (bfd_vma) -2)
abort ();
- relocation = htab->elf.sgot->output_offset + off - got_base;
+ relocation = off;
unresolved_reloc = FALSE;
howto = tilepro_elf_howto_table + r_type;
break;
Index: bfd/elfxx-tilegx.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-tilegx.c,v
retrieving revision 1.14
diff -u -p -r1.14 elfxx-tilegx.c
--- bfd/elfxx-tilegx.c 2 Sep 2012 12:17:27 -0000 1.14
+++ bfd/elfxx-tilegx.c 17 Sep 2012 10:47:58 -0000
@@ -3479,7 +3479,7 @@ tilegx_elf_relocate_section (bfd *output
local_got_offsets[r_symndx] |= 1;
}
}
- relocation = htab->elf.sgot->output_offset + off - got_base;
+ relocation = off;
break;
case R_TILEGX_JUMPOFF_X1_PLT:
@@ -3926,7 +3926,7 @@ tilegx_elf_relocate_section (bfd *output
if (off >= (bfd_vma) -2)
abort ();
- relocation = htab->elf.sgot->output_offset + off - got_base;
+ relocation = off;
unresolved_reloc = FALSE;
howto = tilegx_elf_howto_table + r_type;
break;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Build regression with --enable-targets=all [Re: [committed] TILE-Gx/TILEPro: fix got relocations for merged .got/.got.plt]
2012-09-17 10:57 [committed] TILE-Gx/TILEPro: fix got relocations for merged .got/.got.plt Walter Lee
@ 2012-09-17 13:22 ` Jan Kratochvil
2012-09-17 18:06 ` Walter Lee
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2012-09-17 13:22 UTC (permalink / raw)
To: Walter Lee; +Cc: binutils
On Mon, 17 Sep 2012 12:57:03 +0200, Walter Lee wrote:
> * elf32-tilepro.c (tilepro_elf_relocate_section): Fix computation
> of got relocations for when .got.plt section is merged with .got.
> * elfxx-tilegx.c (tilegx_elf_relocate_section): Ditto.
gcc-4.7.1-5.fc18.x86_64
elf32-tilepro.c: In function ‘tilepro_elf_relocate_section’:
elf32-tilepro.c:2788:11: error: variable ‘got_base’ set but not used [-Werror=unused-but-set-variable]
elfxx-tilegx.c: In function ‘tilegx_elf_relocate_section’:
elfxx-tilegx.c:3097:11: error: variable ‘got_base’ set but not used [-Werror=unused-but-set-variable]
Thanks for a fix,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Build regression with --enable-targets=all [Re: [committed] TILE-Gx/TILEPro: fix got relocations for merged .got/.got.plt]
2012-09-17 13:22 ` Build regression with --enable-targets=all [Re: [committed] TILE-Gx/TILEPro: fix got relocations for merged .got/.got.plt] Jan Kratochvil
@ 2012-09-17 18:06 ` Walter Lee
0 siblings, 0 replies; 3+ messages in thread
From: Walter Lee @ 2012-09-17 18:06 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: binutils
On 9/17/2012 9:21 AM, Jan Kratochvil wrote:> On Mon, 17 Sep 2012 12:57:03 +0200,
Walter Lee wrote:
>> * elf32-tilepro.c (tilepro_elf_relocate_section): Fix computation
>> of got relocations for when .got.plt section is merged with .got.
>> * elfxx-tilegx.c (tilegx_elf_relocate_section): Ditto.
>
> gcc-4.7.1-5.fc18.x86_64
>
> elf32-tilepro.c: In function ‘tilepro_elf_relocate_section’:
> elf32-tilepro.c:2788:11: error: variable ‘got_base’ set but not used [-Werror=unused-but-set-variable]
> elfxx-tilegx.c: In function ‘tilegx_elf_relocate_section’:
> elfxx-tilegx.c:3097:11: error: variable ‘got_base’ set but not used [-Werror=unused-but-set-variable]
Thanks for the heads up. The following fix has been committed, and verified
with 4.7.2 RC.
* elf32-tilepro.c (tilepro_elf_relocate_section): Remove unused
got_base variable.
* elfxx-tilegx.c (tilegx_elf_relocate_section): Ditto.
Index: bfd/elf32-tilepro.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-tilepro.c,v
retrieving revision 1.13
diff -u -p -r1.13 elf32-tilepro.c
--- bfd/elf32-tilepro.c 17 Sep 2012 10:53:38 -0000 1.13
+++ bfd/elf32-tilepro.c 17 Sep 2012 17:59:00 -0000
@@ -2785,7 +2785,6 @@ tilepro_elf_relocate_section (bfd *outpu
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
bfd_vma *local_got_offsets;
- bfd_vma got_base;
asection *sreloc;
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
@@ -2797,11 +2796,6 @@ tilepro_elf_relocate_section (bfd *outpu
sym_hashes = elf_sym_hashes (input_bfd);
local_got_offsets = elf_local_got_offsets (input_bfd);
- if (elf_hash_table (info)->hgot == NULL)
- got_base = 0;
- else
- got_base = elf_hash_table (info)->hgot->root.u.def.value;
-
sreloc = elf_section_data (input_section)->sreloc;
rel = relocs;
Index: bfd/elfxx-tilegx.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-tilegx.c,v
retrieving revision 1.15
diff -u -p -r1.15 elfxx-tilegx.c
--- bfd/elfxx-tilegx.c 17 Sep 2012 10:53:38 -0000 1.15
+++ bfd/elfxx-tilegx.c 17 Sep 2012 17:59:00 -0000
@@ -3094,7 +3094,6 @@ tilegx_elf_relocate_section (bfd *output
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
bfd_vma *local_got_offsets;
- bfd_vma got_base;
asection *sreloc;
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
@@ -3106,11 +3105,6 @@ tilegx_elf_relocate_section (bfd *output
sym_hashes = elf_sym_hashes (input_bfd);
local_got_offsets = elf_local_got_offsets (input_bfd);
- if (elf_hash_table (info)->hgot == NULL)
- got_base = 0;
- else
- got_base = elf_hash_table (info)->hgot->root.u.def.value;
-
sreloc = elf_section_data (input_section)->sreloc;
rel = relocs;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-17 18:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-17 10:57 [committed] TILE-Gx/TILEPro: fix got relocations for merged .got/.got.plt Walter Lee
2012-09-17 13:22 ` Build regression with --enable-targets=all [Re: [committed] TILE-Gx/TILEPro: fix got relocations for merged .got/.got.plt] Jan Kratochvil
2012-09-17 18:06 ` Walter Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).