public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 7/9] [ARC] Fixed TLS for IE model.
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
                   ` (3 preceding siblings ...)
  2017-05-23 15:41 ` [PATCH 6/9] [ARC] Add RELOC_FOR_GLOBAL_SYMBOL in ARC target code Cupertino Miranda
@ 2017-05-23 15:41 ` Cupertino Miranda
  2017-06-06 12:25   ` Nick Clifton
  2017-05-23 15:41 ` [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is requested Cupertino Miranda
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

In the case of static relocation, the GOT entries are fixed at link time
and are set by the linker.
In order to compute the right TLS offset it is necessary to add TCB_SIZE
to the offset, just in case the dynamic linker is not expected to be
executed (static linked case).
This problem does appear in dynamic linked applications, as the dynamic
linker is adding this TCB_SIZE by operating the TCB block structure.

Problem revealed in GLIBC with static linking.

bfd/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>

	arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
	patched section contents for TLS IE reloc.
	elf32-arc.c: Remove TCB_SIZE preprocessor macro.

Rebase to 0006
---
 bfd/arc-got.h                   | 7 ++++++-
 bfd/elf32-arc.c                 | 1 -
 ld/testsuite/ld-arc/tls_ie-01.d | 4 ++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/bfd/arc-got.h b/bfd/arc-got.h
index b8a6d15..f1f6c0e 100644
--- a/bfd/arc-got.h
+++ b/bfd/arc-got.h
@@ -22,6 +22,8 @@
 #ifndef ARC_GOT_H
 #define ARC_GOT_H
 
+#define TCB_SIZE (8)
+
 enum tls_type_e
 {
   GOT_UNKNOWN = 0,
@@ -354,7 +356,8 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **          list_p,
 		  = tls_sec->output_section->vma;
 
 		bfd_put_32 (output_bfd,
-			    sym_value - sec_vma,
+			    sym_value - sec_vma
+			    + (elf_hash_table (info)->dynamic_sections_created ? 0 : TCB_SIZE),
 			    htab->sgot->contents + entry->offset
 			    + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
 			       ? 4 : 0));
@@ -478,8 +481,10 @@ GOT_OFFSET = %#lx, GOT_VMA = %#lx, INDEX = %ld, ADDEND = 0x0\n",
 	{
 	  bfd_vma addend = 0;
 	  if (list->type == GOT_TLS_IE)
+	  {
 	    addend = bfd_get_32 (output_bfd,
 				 htab->sgot->contents + got_offset);
+	  }
 
 	  ADD_RELA (output_bfd, got,
 		    got_offset + (e == TLS_GOT_MOD_AND_OFF ? 4 : 0),
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 117253d..928dd68 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1183,7 +1183,6 @@ arc_special_overflow_checks (const struct arc_relocation_data reloc_data,
 #define TLS_REL (bfd_signed_vma) \
   ((elf_hash_table (info))->tls_sec->output_section->vma)
 #define TLS_TBSS (8)
-#define TCB_SIZE (8)
 
 #define none (0)
 
diff --git a/ld/testsuite/ld-arc/tls_ie-01.d b/ld/testsuite/ld-arc/tls_ie-01.d
index 304973c..62b3932 100644
--- a/ld/testsuite/ld-arc/tls_ie-01.d
+++ b/ld/testsuite/ld-arc/tls_ie-01.d
@@ -1,10 +1,10 @@
 #source: tls_ie-01.s
 #as: -mcpu=arc700
-#ld:
+#ld: -static
 #objdump: -s -j .got
 #xfail: arc*-*-elf*
 
 [^:]+:     file format elf32-littlearc
 
 Contents of section \.got:
- [0-9a-f]+ 00000000 04000000 .+
+ [0-9a-f]+ 08000000 0c000000 +.+
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 5/9] [ARC] ARC_PC32 dynamic reloc incorrectly generated.
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
  2017-05-23 15:41 ` [PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation Cupertino Miranda
@ 2017-05-23 15:41 ` Cupertino Miranda
  2017-06-06 12:21   ` Nick Clifton
  2017-05-23 15:41 ` [PATCH 3/9] [ARC] Reassign the symbol got information to actual symbol when indirect Cupertino Miranda
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

Fixed issue related to the generation of ARC_PC32 dynamic relocs when symbol
is dynamic but still defined in a non shared object.

bfd/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>

	elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
	changes.
---
 bfd/elf32-arc.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 784bc0a..901218a 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1709,16 +1709,22 @@ elf_arc_relocate_section (bfd *		          output_bfd,
 	    }
 	}
 
+
+#define IS_ARC_PCREL_TYPE(TYPE) \
+  (   (TYPE == R_ARC_PC32)      \
+   || (TYPE == R_ARC_32_PCREL))
+
       switch (r_type)
 	{
 	  case R_ARC_32:
 	  case R_ARC_32_ME:
 	  case R_ARC_PC32:
 	  case R_ARC_32_PCREL:
-	    if ((bfd_link_pic (info))
-		&& ((r_type != R_ARC_PC32 && r_type != R_ARC_32_PCREL)
+	    if (bfd_link_pic (info)
+		&& (!IS_ARC_PCREL_TYPE (r_type)
 		    || (h != NULL
 			&& h->dynindx != -1
+			&& !h->def_regular
 			&& (!info->symbolic || !h->def_regular))))
 	      {
 		Elf_Internal_Rela outrel;
@@ -1735,6 +1741,7 @@ elf_arc_relocate_section (bfd *		          output_bfd,
 							   info,
 							   input_section,
 							   rel->r_offset);
+
 		if (outrel.r_offset == (bfd_vma) -1)
 		  skip = TRUE;
 
@@ -1742,10 +1749,6 @@ elf_arc_relocate_section (bfd *		          output_bfd,
 		outrel.r_offset += (input_section->output_section->vma
 				    + input_section->output_offset);
 
-#define IS_ARC_PCREL_TYPE(TYPE) \
-  (   (TYPE == R_ARC_PC32)      \
-   || (TYPE == R_ARC_32_PCREL))
-
 		if (skip)
 		  {
 		    memset (&outrel, 0, sizeof outrel);
@@ -1753,10 +1756,10 @@ elf_arc_relocate_section (bfd *		          output_bfd,
 		  }
 		else if (h != NULL
 			 && h->dynindx != -1
-			 && ((IS_ARC_PCREL_TYPE (r_type))
-			 || !(bfd_link_executable (info)
-			      || SYMBOLIC_BIND (info, h))
-			 || ! h->def_regular))
+			 && (IS_ARC_PCREL_TYPE (r_type)
+			     || !(bfd_link_executable (info)
+				  || SYMBOLIC_BIND (info, h))
+			     || ! h->def_regular))
 		  {
 		    BFD_ASSERT (h != NULL);
 		    if ((input_section->flags & SEC_ALLOC) != 0)
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation.
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
@ 2017-05-23 15:41 ` Cupertino Miranda
  2017-06-06 12:28   ` Nick Clifton
  2017-05-23 15:41 ` [PATCH 5/9] [ARC] ARC_PC32 dynamic reloc incorrectly generated Cupertino Miranda
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

Fixed conditions to create the dynamic sections.
Previously there would be times where the dynamic sections would not be created
although they were actually required for linking to work.

Issue found through OpenADK build, more precisely the ublicb testsuite package.

bfd/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>

	elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
	dynamic sections.
---
 bfd/elf32-arc.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 5f8c69f..4926a01 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1900,10 +1900,14 @@ elf_arc_check_relocs (bfd *			 abfd,
   const Elf_Internal_Rela *	rel_end;
   bfd *				dynobj;
   asection *			sreloc = NULL;
+  struct elf_link_hash_table *	htab = elf_hash_table (info);
 
   if (bfd_link_relocatable (info))
     return TRUE;
 
+  if (htab->dynobj == NULL)
+    htab->dynobj = abfd;
+
   dynobj = (elf_hash_table (info))->dynobj;
   symtab_hdr = &((elf_tdata (abfd))->symtab_hdr);
   sym_hashes = elf_sym_hashes (abfd);
@@ -1925,15 +1929,6 @@ elf_arc_check_relocs (bfd *			 abfd,
 	}
       howto = arc_elf_howto (r_type);
 
-      if (dynobj == NULL
-	  && (is_reloc_for_GOT (howto)
-	      || is_reloc_for_TLS (howto)))
-	{
-	  dynobj = elf_hash_table (info)->dynobj = abfd;
-	  if (! _bfd_elf_create_got_section (abfd, info))
-	    return FALSE;
-	}
-
       /* Load symbol information.  */
       r_symndx = ELF32_R_SYM (rel->r_info);
       if (r_symndx < symtab_hdr->sh_info) /* Is a local symbol.  */
@@ -1990,6 +1985,10 @@ elf_arc_check_relocs (bfd *			 abfd,
 	      {
 		if (sreloc == NULL)
 		  {
+		    if (info->dynamic
+			&& ! htab->dynamic_sections_created
+			&& ! _bfd_elf_link_create_dynamic_sections (abfd, info))
+		      return FALSE;
 		    sreloc = _bfd_elf_make_dynamic_reloc_section (sec, dynobj,
 								  2, abfd,
 								  /*rela*/
@@ -2017,6 +2016,9 @@ elf_arc_check_relocs (bfd *			 abfd,
       if (is_reloc_for_GOT (howto)
 	  || is_reloc_for_TLS (howto))
 	{
+	  if (! _bfd_elf_create_got_section (dynobj, info))
+	    return FALSE;
+
 	  arc_fill_got_info_for_reloc (
 		  arc_got_entry_type_for_reloc (howto),
 		  get_got_entry_list_for_symbol (abfd, r_symndx, h),
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is local.
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
                   ` (6 preceding siblings ...)
  2017-05-23 15:41 ` [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_ Cupertino Miranda
@ 2017-05-23 15:41 ` Cupertino Miranda
  2017-06-06 12:13   ` Nick Clifton
  2017-05-24  6:09 ` [PATCH 8/9] [ARC] Fixed condition to generate TEXTREL Cupertino Miranda
  2017-06-08 17:06 ` [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

R_ARC_32 and R_ARC_32_ME cannot be generated as dynamic relocs.
However, a warning message and check_relocs was aborting when this type of
reloc was being resolved to a local symbol.
This is wrong as local symbols are resolvable at link time.

bfd/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_check_relocs): Added condition to disable
	warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
---
 bfd/elf32-arc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 33166f2..fd17128 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1934,7 +1934,8 @@ elf_arc_check_relocs (bfd *			 abfd,
 	       and the dynamic linker can not resolve these.  However
 	       the error should not occur for e.g. debugging or
 	       non-readonly sections.  */
-	    if ((bfd_link_dll (info) && !bfd_link_pie (info))
+	    if (h != NULL
+		&& (bfd_link_dll (info) && !bfd_link_pie (info))
 		&& (sec->flags & SEC_ALLOC) != 0
 		&& (sec->flags & SEC_READONLY) != 0
 		&& ((sec->flags & SEC_CODE) != 0
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
                   ` (5 preceding siblings ...)
  2017-05-23 15:41 ` [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is requested Cupertino Miranda
@ 2017-05-23 15:41 ` Cupertino Miranda
  2017-06-06 12:19   ` Nick Clifton
  2017-05-23 15:41 ` [PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is local Cupertino Miranda
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils
  Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard, Vineet Gupta

From: Vineet Gupta <vgupta@synopsys.com>

Historically the arc abi demanded that a GOT[0] should be referencible as
[pc+_DYNAMIC@gotpc].  Hence we convert a _DYNAMIC@gotpc to a GOTPC reference to
_GLOBAL_OFFSET_TABLE_.

This is no longer the case and uClibc and upcomming GNU libc don't expect this
to happen.

gas/ChangeLog:

    Vineet Gupta  <vgupta@synopsys.com>
    Cupertino Miranda  <cmiranda@synopsys.com>

	* config/tc-arc.c (md_undefined_symbol): Changed.
	* config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
---
 gas/config/tc-arc.c | 5 +----
 gas/config/tc-arc.h | 1 -
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index a092892..df83ba7 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -3301,10 +3301,7 @@ md_undefined_symbol (char *name)
      GOTPC reference to _GLOBAL_OFFSET_TABLE_.  */
   if (((*name == '_')
        && (*(name+1) == 'G')
-       && (strcmp (name, GLOBAL_OFFSET_TABLE_NAME) == 0))
-      || ((*name == '_')
-	  && (*(name+1) == 'D')
-	  && (strcmp (name, DYNAMIC_STRUCT_NAME) == 0)))
+       && (strcmp (name, GLOBAL_OFFSET_TABLE_NAME) == 0)))
     {
       if (!GOT_symbol)
 	{
diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h
index f4cafe9..f887fcc 100644
--- a/gas/config/tc-arc.h
+++ b/gas/config/tc-arc.h
@@ -171,7 +171,6 @@ extern long md_pcrel_from_section (struct fix *, segT);
 #define tc_frob_label(S)  arc_frob_label (S)
 
 #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
-#define DYNAMIC_STRUCT_NAME "_DYNAMIC"
 
 /* We need to take care of not having section relative fixups for the
    fixups with respect to Position Independent Code.  */
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 0/8] [ARC] Several fixes for ARC linker
@ 2017-05-23 15:41 Cupertino Miranda
  2017-05-23 15:41 ` [PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation Cupertino Miranda
                   ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

Hi,

Please find attach a series of patches fixing several identified issues for
ARC linker.


[PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is
[PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is
[PATCH 3/9] [ARC] Reassign the symbol got information to actual

  FAIL -> UNSUPPORTED: Run pr18718 with PIE (1)
  FAIL -> UNSUPPORTED: Run pr18718 with PIE (2)
  FAIL -> UNSUPPORTED: Run pr18718 with PIE (3)
  FAIL -> UNSUPPORTED: Run pr18718 with PIE (4)
  FAIL -> UNSUPPORTED: Run pr18718 with PIC (1)
  FAIL -> UNSUPPORTED: Run pr18718 with PIC (2)
  FAIL -> UNSUPPORTED: Run pr18718 with PIC (3)
  FAIL -> UNSUPPORTED: Run pr18718 with PIC (4)

[PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_
[PATCH 5/9] [ARC] ARC_PC32 dynamic reloc incorrectly generated.
[PATCH 6/9] [ARC] Add RELOC_FOR_GLOBAL_SYMBOL in ARC target code.

  PASS -> FAIL: plugin claimfile lost symbol
  PASS -> FAIL: plugin claimfile replace symbol
  PASS -> FAIL: plugin claimfile resolve symbol
  PASS -> FAIL: plugin claimfile lost symbol with source
  PASS -> FAIL: plugin claimfile replace symbol with source
  PASS -> FAIL: plugin claimfile resolve symbol with source
  PASS -> FAIL: plugin 2 with source lib
  PASS -> FAIL: load plugin 2 with source
  PASS -> FAIL: plugin 3 with source lib
  PASS -> FAIL: load plugin 3 with source

  This is the case because after adding RELOC_FOR_GLOBAL_SYMBOL, the linker
  became more meticulous identifying undefined symbols.
  After breafly checking the logs, I noticed that our target fails to pass those
  tests as it aborts with a undefined symbol message. ARM for example reports
  the same undefined symbol, however it does not abort the linker.

[PATCH 7/9] [ARC] Fixed TLS for IE model.
[PATCH 8/9] [ARC] Fixed condition to generate TEXTREL.

  FAIL -> UNSUPPORTED: Run pr19579
  FAIL -> UNSUPPORTED: Run pr19579 (-z now)

[PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation.

Looking forward to your review.

Cheers,
Cupertino

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 6/9] [ARC] Add RELOC_FOR_GLOBAL_SYMBOL in ARC target code.
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
                   ` (2 preceding siblings ...)
  2017-05-23 15:41 ` [PATCH 3/9] [ARC] Reassign the symbol got information to actual symbol when indirect Cupertino Miranda
@ 2017-05-23 15:41 ` Cupertino Miranda
  2017-06-06 12:23   ` Nick Clifton
  2017-05-23 15:41 ` [PATCH 7/9] [ARC] Fixed TLS for IE model Cupertino Miranda
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

This miss was identified in the context of openssh building for ARC.

bfd/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>

	elf32-arc.c (elf_arc_relocate_section): Added "call" to
	RELOC_FOR_GLOBAL_SYMBOL macro.
---
 bfd/elf32-arc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 901218a..117253d 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1408,6 +1408,7 @@ elf_arc_relocate_section (bfd *		          output_bfd,
       asection *		    sec;
       struct elf_link_hash_entry *  h2;
       const char *                  msg;
+      bfd_boolean		    unresolved_reloc = FALSE;
 
       struct arc_relocation_data reloc_data =
       {
@@ -1495,6 +1496,14 @@ elf_arc_relocate_section (bfd *		          output_bfd,
 	}
       else
 	{
+	  bfd_boolean warned, ignored;
+	  bfd_vma relocation ATTRIBUTE_UNUSED;
+
+	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+				   r_symndx, symtab_hdr, sym_hashes,
+				   h, sec, relocation,
+				   unresolved_reloc, warned, ignored);
+
 	  /* TODO: This code is repeated from below.  We should
 	     clean it and remove duplications.
 	     Sec is used check for discarded sections.
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is requested.
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
                   ` (4 preceding siblings ...)
  2017-05-23 15:41 ` [PATCH 7/9] [ARC] Fixed TLS for IE model Cupertino Miranda
@ 2017-05-23 15:41 ` Cupertino Miranda
  2017-06-06 12:09   ` Nick Clifton
  2017-05-23 15:41 ` [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_ Cupertino Miranda
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

bfd/Changelog:

    Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (ADD_RELA): Changed to only work when dynamic object is
	created.
---
 bfd/elf32-arc.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 3e99cab..33166f2 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -55,17 +55,20 @@ name_for_global_symbol (struct elf_link_hash_entry *h)
     Elf_Internal_Rela _rel;						\
     bfd_byte * _loc;							\
 									\
-    BFD_ASSERT (_htab->srel##SECTION &&_htab->srel##SECTION->contents); \
-    _loc = _htab->srel##SECTION->contents				\
-      + ((_htab->srel##SECTION->reloc_count)				\
-	 * sizeof (Elf32_External_Rela));				\
-    _htab->srel##SECTION->reloc_count++;				\
-    _rel.r_addend = ADDEND;						\
-    _rel.r_offset = (_htab->s##SECTION)->output_section->vma		\
-      + (_htab->s##SECTION)->output_offset + OFFSET;			\
-    BFD_ASSERT ((long) SYM_IDX != -1);					\
-    _rel.r_info = ELF32_R_INFO (SYM_IDX, TYPE);				\
-    bfd_elf32_swap_reloca_out (BFD, &_rel, _loc);			\
+    if (_htab->dynamic_sections_created == TRUE)				\
+      {									\
+	BFD_ASSERT (_htab->srel##SECTION &&_htab->srel##SECTION->contents); \
+    	_loc = _htab->srel##SECTION->contents				\
+    	  + ((_htab->srel##SECTION->reloc_count)			\
+    	     * sizeof (Elf32_External_Rela));				\
+    	_htab->srel##SECTION->reloc_count++;				\
+    	_rel.r_addend = ADDEND;						\
+    	_rel.r_offset = (_htab->s##SECTION)->output_section->vma	\
+    	  + (_htab->s##SECTION)->output_offset + OFFSET;		\
+    	BFD_ASSERT ((long) SYM_IDX != -1);				\
+    	_rel.r_info = ELF32_R_INFO (SYM_IDX, TYPE);			\
+    	bfd_elf32_swap_reloca_out (BFD, &_rel, _loc);			\
+      }									\
   }
 
 
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 3/9] [ARC] Reassign the symbol got information to actual symbol when indirect.
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
  2017-05-23 15:41 ` [PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation Cupertino Miranda
  2017-05-23 15:41 ` [PATCH 5/9] [ARC] ARC_PC32 dynamic reloc incorrectly generated Cupertino Miranda
@ 2017-05-23 15:41 ` Cupertino Miranda
  2017-06-06 12:16   ` Nick Clifton
  2017-05-23 15:41 ` [PATCH 6/9] [ARC] Add RELOC_FOR_GLOBAL_SYMBOL in ARC target code Cupertino Miranda
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-23 15:41 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

GOT information would not be reassign to symbol when it became a indect
symbol.

bfd/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
	symbols.
---
 bfd/elf32-arc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index fd17128..784bc0a 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1584,7 +1584,12 @@ elf_arc_relocate_section (bfd *		          output_bfd,
 
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
+	  {
+	    struct elf_link_hash_entry *h_old = h;
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+	    if (h->got.glist == 0 && h_old->got.glist != h->got.glist)
+	      h->got.glist = h_old->got.glist;
+	  }
 
 	  /* TODO: Need to validate what was the intention.  */
 	  /* BFD_ASSERT ((h->dynindx == -1) || (h->forced_local != 0)); */
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 8/9] [ARC] Fixed condition to generate TEXTREL.
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
                   ` (7 preceding siblings ...)
  2017-05-23 15:41 ` [PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is local Cupertino Miranda
@ 2017-05-24  6:09 ` Cupertino Miranda
  2017-06-06 12:27   ` Nick Clifton
  2017-06-08 17:06 ` [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
  9 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-05-24  6:09 UTC (permalink / raw)
  To: binutils; +Cc: Cupertino.Miranda, Claudiu.Zissulescu, Francois.Bedard

TEXTREL was being generated even when relocatable .o files had the .rela.text
section. Now it is limitted only to dynamic object files that still have them.
Nevertheless, our target aborts in those cases due to architecture limitations
where icache is not coherent with dcache, and to force this coherence expensive
kernel level support would be needed.

bfd/ChangeLog:

    Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
	require TEXTREL.
---
 bfd/elf32-arc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 928dd68..5f8c69f 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -2643,7 +2643,8 @@ elf_arc_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
 		  const char *name = s->name + 5;
 		  bfd *ibfd;
 		  for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link.next)
-		    if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour)
+		    if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour
+			&& ibfd->flags & DYNAMIC)
 		      {
 			asection *target = bfd_get_section_by_name (ibfd, name);
 			if (target != NULL
-- 
2.9.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is requested.
  2017-05-23 15:41 ` [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is requested Cupertino Miranda
@ 2017-06-06 12:09   ` Nick Clifton
  2017-06-06 16:07     ` Cupertino Miranda
  0 siblings, 1 reply; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:09 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

  First of all - sorry for taking so long to look at this patch series.

> 	* elf32-arc.c (ADD_RELA): Changed to only work when dynamic object is
> 	created.

One thing that struck me about this patch is - what should happen if dynamic
sections are not being created ?  IE is it an error to invoke the ADD_RELA
macro if dynamic sections are not being emitted ?  If so, then maybe this
macro should be extended to include an error message...

Cheers
  Nick


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is local.
  2017-05-23 15:41 ` [PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is local Cupertino Miranda
@ 2017-06-06 12:13   ` Nick Clifton
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:13 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

> bfd/ChangeLog:
> 
>      Cupertino Miranda  <cmiranda@synopsys.com>
> 
> 	* elf32-arc.c (elf_arc_check_relocs): Added condition to disable
> 	warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.

Approved - please apply.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/9] [ARC] Reassign the symbol got information to actual symbol when indirect.
  2017-05-23 15:41 ` [PATCH 3/9] [ARC] Reassign the symbol got information to actual symbol when indirect Cupertino Miranda
@ 2017-06-06 12:16   ` Nick Clifton
  2017-06-06 16:09     ` Cupertino Miranda
  0 siblings, 1 reply; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:16 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

> bfd/ChangeLog:
> 
>      Cupertino Miranda  <cmiranda@synopsys.com>
> 
> 	* elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
> 	symbols.

Approved - please apply.

By the way - do you have testcases for these patches ?  It would be nice to
make sure that the problems stay fixed...

Cheers
  Nick

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_
  2017-05-23 15:41 ` [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_ Cupertino Miranda
@ 2017-06-06 12:19   ` Nick Clifton
  2017-06-06 16:08     ` Cupertino Miranda
  0 siblings, 1 reply; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:19 UTC (permalink / raw)
  To: Cupertino Miranda, binutils
  Cc: Claudiu.Zissulescu, Francois.Bedard, Vineet Gupta

Hi Cupertino,

> From: Vineet Gupta <vgupta@synopsys.com>
> 
> Historically the arc abi demanded that a GOT[0] should be referencible as
> [pc+_DYNAMIC@gotpc].  Hence we convert a _DYNAMIC@gotpc to a GOTPC reference to
> _GLOBAL_OFFSET_TABLE_.
> 
> This is no longer the case and uClibc and upcomming GNU libc don't expect this
> to happen.

Is there going to be a legacy problem with this change to the ABI ?

IE is it possible that code compiled with the old ABI will be linked with code
compiled with the new ABI, and hence run into problems ?
 
Cheers
  Nick

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 5/9] [ARC] ARC_PC32 dynamic reloc incorrectly generated.
  2017-05-23 15:41 ` [PATCH 5/9] [ARC] ARC_PC32 dynamic reloc incorrectly generated Cupertino Miranda
@ 2017-06-06 12:21   ` Nick Clifton
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:21 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

> bfd/ChangeLog:
> 
>      Cupertino Miranda  <cmiranda@synopsys.com>
> 
> 	elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
> 	changes.

Approved - please apply.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 6/9] [ARC] Add RELOC_FOR_GLOBAL_SYMBOL in ARC target code.
  2017-05-23 15:41 ` [PATCH 6/9] [ARC] Add RELOC_FOR_GLOBAL_SYMBOL in ARC target code Cupertino Miranda
@ 2017-06-06 12:23   ` Nick Clifton
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:23 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

> bfd/ChangeLog:
> 
>      Cupertino Miranda  <cmiranda@synopsys.com>
> 
> 	elf32-arc.c (elf_arc_relocate_section): Added "call" to
> 	RELOC_FOR_GLOBAL_SYMBOL macro.

Approved - please apply.

Cheers
  Nick

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 7/9] [ARC] Fixed TLS for IE model.
  2017-05-23 15:41 ` [PATCH 7/9] [ARC] Fixed TLS for IE model Cupertino Miranda
@ 2017-06-06 12:25   ` Nick Clifton
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:25 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

> bfd/ChangeLog:
> 
>      Cupertino Miranda  <cmiranda@synopsys.com>
> 
> 	arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
> 	patched section contents for TLS IE reloc.
> 	elf32-arc.c: Remove TCB_SIZE preprocessor macro.

Approved - please apply.

Note - your patch did not include a changelog entry for the new linker
test, but that part is approved as well, as long as you do add a changelog
entry.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 8/9] [ARC] Fixed condition to generate TEXTREL.
  2017-05-24  6:09 ` [PATCH 8/9] [ARC] Fixed condition to generate TEXTREL Cupertino Miranda
@ 2017-06-06 12:27   ` Nick Clifton
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:27 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

> bfd/ChangeLog:
> 
>      Cupertino Miranda  <cmiranda@synopsys.com>
> 
> 	* elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
> 	require TEXTREL.

Approved - please apply.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation.
  2017-05-23 15:41 ` [PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation Cupertino Miranda
@ 2017-06-06 12:28   ` Nick Clifton
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Clifton @ 2017-06-06 12:28 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

> bfd/ChangeLog:
> 
>      Cupertino Miranda  <cmiranda@synopsys.com>
> 
> 	elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
> 	dynamic sections.

Approved - please apply.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is requested.
  2017-06-06 12:09   ` Nick Clifton
@ 2017-06-06 16:07     ` Cupertino Miranda
  2017-06-07 12:23       ` Nick Clifton
  0 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-06-06 16:07 UTC (permalink / raw)
  To: Nick Clifton, Cupertino Miranda, binutils
  Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Nick,

If one invokes ADD_RELA when no dynamic sections get created, it would
segmentation fault.
However, invocations to this macro are being done eagerly and that is
the reason for the simple condition fix.

Honestly, thinking about it now I do not find a use case where it would
be helpful to return an error message, but I can be wrong. :-(
Do you have use case in mind?

Cheers,
Cupertino

On 06/06/2017 02:09 PM, Nick Clifton wrote:
> Hi Cupertino,
>
>   First of all - sorry for taking so long to look at this patch series.
>
>> 	* elf32-arc.c (ADD_RELA): Changed to only work when dynamic object is
>> 	created.
> One thing that struck me about this patch is - what should happen if dynamic
> sections are not being created ?  IE is it an error to invoke the ADD_RELA
> macro if dynamic sections are not being emitted ?  If so, then maybe this
> macro should be extended to include an error message...
>
> Cheers
>   Nick
>
>
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_
  2017-06-06 12:19   ` Nick Clifton
@ 2017-06-06 16:08     ` Cupertino Miranda
  2017-06-06 18:28       ` Vineet Gupta
  0 siblings, 1 reply; 26+ messages in thread
From: Cupertino Miranda @ 2017-06-06 16:08 UTC (permalink / raw)
  To: Nick Clifton, Cupertino Miranda, binutils
  Cc: Claudiu.Zissulescu, Francois.Bedard, Vineet Gupta

Hi Nick,

Yes, there is some sort of incompatibility to legacy code.
However, as far as we know this was a special relocation / assembly
exception only used for uClibc dynamic loader, in order to compute
library relative virtual offset.

This was part of the old tools never upstreamed, and the side effects /
problems created with it were unnoticed by us when we first start
upstreaming.
More recently, I have been involved in porting glibc for ARC and I have
came across this "naughtiness", and suggested to clean it up, for uclibc
and glibc.

Current version of uClibc is no longer relying on it.

In my opinion, it is unlikely some other project except uClibc will be
affected by this change.

Best regards,
Cupertino

On 06/06/2017 02:19 PM, Nick Clifton wrote:
> Hi Cupertino,
>
>> From: Vineet Gupta <vgupta@synopsys.com>
>>
>> Historically the arc abi demanded that a GOT[0] should be referencible as
>> [pc+_DYNAMIC@gotpc].  Hence we convert a _DYNAMIC@gotpc to a GOTPC reference to
>> _GLOBAL_OFFSET_TABLE_.
>>
>> This is no longer the case and uClibc and upcomming GNU libc don't expect this
>> to happen.
> Is there going to be a legacy problem with this change to the ABI ?
>
> IE is it possible that code compiled with the old ABI will be linked with code
> compiled with the new ABI, and hence run into problems ?
>  
> Cheers
>   Nick
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/9] [ARC] Reassign the symbol got information to actual symbol when indirect.
  2017-06-06 12:16   ` Nick Clifton
@ 2017-06-06 16:09     ` Cupertino Miranda
  0 siblings, 0 replies; 26+ messages in thread
From: Cupertino Miranda @ 2017-06-06 16:09 UTC (permalink / raw)
  To: Nick Clifton, Cupertino Miranda, binutils
  Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Nick,

This problem was identified in the context of porting glibc for ARC.
Back then I did not realize but I believe this is more of a workaround
for the lack of support for IFUNC.

I will soon start working in iFUNC support and this will be revisited.

Cheers,
Cupertino

On 06/06/2017 02:16 PM, Nick Clifton wrote:
> Hi Cupertino,
>
>> bfd/ChangeLog:
>>
>>      Cupertino Miranda  <cmiranda@synopsys.com>
>>
>> 	* elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
>> 	symbols.
> Approved - please apply.
>
> By the way - do you have testcases for these patches ?  It would be nice to
> make sure that the problems stay fixed...
>
> Cheers
>   Nick
>
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_
  2017-06-06 16:08     ` Cupertino Miranda
@ 2017-06-06 18:28       ` Vineet Gupta
  2017-06-07 12:21         ` Nick Clifton
  0 siblings, 1 reply; 26+ messages in thread
From: Vineet Gupta @ 2017-06-06 18:28 UTC (permalink / raw)
  To: Cupertino Miranda, Nick Clifton, Cupertino Miranda, binutils
  Cc: Claudiu.Zissulescu, Francois.Bedard

On 06/06/2017 09:08 AM, Cupertino Miranda wrote:
> More recently, I have been involved in porting glibc for ARC and I have
> came across this "naughtiness", and suggested to clean it up, for uclibc
> and glibc.
>
> Current version of uClibc is no longer relying on it.

Indeed there is no known code construct out there which relies on the old 
semantics. Before makign this change in tools we made sure uClibc was updated to 
not use this construct. So IMO it is a safe change !

-Vineet

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_
  2017-06-06 18:28       ` Vineet Gupta
@ 2017-06-07 12:21         ` Nick Clifton
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Clifton @ 2017-06-07 12:21 UTC (permalink / raw)
  To: Vineet Gupta, Cupertino Miranda, binutils
  Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Vineet, Hi Cupertino,

> Indeed there is no known code construct out there which relies on the old semantics. Before makign this change in tools we made sure uClibc was updated to not use this construct. So IMO it is a safe change !

In which case this patch is approved.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is requested.
  2017-06-06 16:07     ` Cupertino Miranda
@ 2017-06-07 12:23       ` Nick Clifton
  0 siblings, 0 replies; 26+ messages in thread
From: Nick Clifton @ 2017-06-07 12:23 UTC (permalink / raw)
  To: Cupertino Miranda, binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard

Hi Cupertino,

> If one invokes ADD_RELA when no dynamic sections get created, it would
> segmentation fault.
> However, invocations to this macro are being done eagerly and that is
> the reason for the simple condition fix.
> 
> Honestly, thinking about it now I do not find a use case where it would
> be helpful to return an error message, but I can be wrong. :-(
> Do you have use case in mind?

None - I was just checking.  Plus I like to be paranoid when programming
and it seemed to me that this might be a case where an error message would
have been helpful.  But I understand your argument that the reloc generation
is done eagerly, so I have no more objections to the patch.

Approved - please apply.

Cheers
  Nick

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/8] [ARC] Several fixes for ARC linker
  2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
                   ` (8 preceding siblings ...)
  2017-05-24  6:09 ` [PATCH 8/9] [ARC] Fixed condition to generate TEXTREL Cupertino Miranda
@ 2017-06-08 17:06 ` Cupertino Miranda
  9 siblings, 0 replies; 26+ messages in thread
From: Cupertino Miranda @ 2017-06-08 17:06 UTC (permalink / raw)
  To: binutils; +Cc: Claudiu.Zissulescu, Francois.Bedard, Nick Clifton

Pushed all of the approved patches.

Nick: Thanks for the review and comments.

Best regards,
Cupertino

On 05/23/2017 05:41 PM, Cupertino Miranda wrote:
> Hi,
>
> Please find attach a series of patches fixing several identified issues for
> ARC linker.
>
>
> [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is
> [PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is
> [PATCH 3/9] [ARC] Reassign the symbol got information to actual
>
>   FAIL -> UNSUPPORTED: Run pr18718 with PIE (1)
>   FAIL -> UNSUPPORTED: Run pr18718 with PIE (2)
>   FAIL -> UNSUPPORTED: Run pr18718 with PIE (3)
>   FAIL -> UNSUPPORTED: Run pr18718 with PIE (4)
>   FAIL -> UNSUPPORTED: Run pr18718 with PIC (1)
>   FAIL -> UNSUPPORTED: Run pr18718 with PIC (2)
>   FAIL -> UNSUPPORTED: Run pr18718 with PIC (3)
>   FAIL -> UNSUPPORTED: Run pr18718 with PIC (4)
>
> [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_
> [PATCH 5/9] [ARC] ARC_PC32 dynamic reloc incorrectly generated.
> [PATCH 6/9] [ARC] Add RELOC_FOR_GLOBAL_SYMBOL in ARC target code.
>
>   PASS -> FAIL: plugin claimfile lost symbol
>   PASS -> FAIL: plugin claimfile replace symbol
>   PASS -> FAIL: plugin claimfile resolve symbol
>   PASS -> FAIL: plugin claimfile lost symbol with source
>   PASS -> FAIL: plugin claimfile replace symbol with source
>   PASS -> FAIL: plugin claimfile resolve symbol with source
>   PASS -> FAIL: plugin 2 with source lib
>   PASS -> FAIL: load plugin 2 with source
>   PASS -> FAIL: plugin 3 with source lib
>   PASS -> FAIL: load plugin 3 with source
>
>   This is the case because after adding RELOC_FOR_GLOBAL_SYMBOL, the linker
>   became more meticulous identifying undefined symbols.
>   After breafly checking the logs, I noticed that our target fails to pass those
>   tests as it aborts with a undefined symbol message. ARM for example reports
>   the same undefined symbol, however it does not abort the linker.
>
> [PATCH 7/9] [ARC] Fixed TLS for IE model.
> [PATCH 8/9] [ARC] Fixed condition to generate TEXTREL.
>
>   FAIL -> UNSUPPORTED: Run pr19579
>   FAIL -> UNSUPPORTED: Run pr19579 (-z now)
>
> [PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation.
>
> Looking forward to your review.
>
> Cheers,
> Cupertino
>
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2017-06-08 17:06 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-23 15:41 [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda
2017-05-23 15:41 ` [PATCH 9/9] [ARC] Corrected conditions for dynamic sections creation Cupertino Miranda
2017-06-06 12:28   ` Nick Clifton
2017-05-23 15:41 ` [PATCH 5/9] [ARC] ARC_PC32 dynamic reloc incorrectly generated Cupertino Miranda
2017-06-06 12:21   ` Nick Clifton
2017-05-23 15:41 ` [PATCH 3/9] [ARC] Reassign the symbol got information to actual symbol when indirect Cupertino Miranda
2017-06-06 12:16   ` Nick Clifton
2017-06-06 16:09     ` Cupertino Miranda
2017-05-23 15:41 ` [PATCH 6/9] [ARC] Add RELOC_FOR_GLOBAL_SYMBOL in ARC target code Cupertino Miranda
2017-06-06 12:23   ` Nick Clifton
2017-05-23 15:41 ` [PATCH 7/9] [ARC] Fixed TLS for IE model Cupertino Miranda
2017-06-06 12:25   ` Nick Clifton
2017-05-23 15:41 ` [PATCH 1/9] [ARC] Avoid creating dynamic relocs when static linked is requested Cupertino Miranda
2017-06-06 12:09   ` Nick Clifton
2017-06-06 16:07     ` Cupertino Miranda
2017-06-07 12:23       ` Nick Clifton
2017-05-23 15:41 ` [PATCH 4/9] [ARC] Don't convert _DYNAMIC@ to _GLOBAL_OFFSET_TABLE_ Cupertino Miranda
2017-06-06 12:19   ` Nick Clifton
2017-06-06 16:08     ` Cupertino Miranda
2017-06-06 18:28       ` Vineet Gupta
2017-06-07 12:21         ` Nick Clifton
2017-05-23 15:41 ` [PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is local Cupertino Miranda
2017-06-06 12:13   ` Nick Clifton
2017-05-24  6:09 ` [PATCH 8/9] [ARC] Fixed condition to generate TEXTREL Cupertino Miranda
2017-06-06 12:27   ` Nick Clifton
2017-06-08 17:06 ` [PATCH 0/8] [ARC] Several fixes for ARC linker Cupertino Miranda

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).