This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New ld failure with STB_GNU_UNIQUE patch


Hi Maciej,

>  So it's just that on `ft32-elf' all tests that call LD with no substitute 
> linker script supplied fail with this error, unless they hit `-shared not 
> supported' first.  I think this means that the default linker script is 
> broken, and this newly-enabled test just follows the pattern.  Does this 
> observation address your concern?

It does.

I am going to check in the patch below to address this problem, and several
others in connection with the FT32 target and linker tests.

Cheers
  Nick

ld/ChangeLog
2016-05-18  Nick Clifton  <nickc@redhat.com>

	* scripttempl/ft32.sc: Use fixed constants for memory region
	lengths.  Include DWARF debug sections.
	(.data .bss): Do not assign locations during relocatable links.
	* testsuite/ld-elf/compressed1d.d: Skip for FT32.
	* testsuite/ld-elf/sec-to-seg.exp: Likewise.
	* testsuite/ld-elf/sec64k.exp: Likewise.
	* testsuite/ld-elf/init-fini-array.d: XFail for FT32.
	* testsuite/ld-elf/merge.d: Likewise.
	* testsuite/ld-elf/orphan-region.d: Likewise.
	* testsuite/ld-elf/orphan.s: Likewise.
	* testsuite/ld-elf/orphan3.d: Likewise.
	* testsuite/ld-elf/pr349.d: Likewise.
	* testsuite/ld-elf/warn2.d: Likewise.
	* testsuite/lib/ld-lib.exp (check_shared_lib_support): Note
	that the FT32 does not support shared libraries.
diff --git a/ld/scripttempl/ft32.sc b/ld/scripttempl/ft32.sc
index 5f5df22..bc55d10 100644
--- a/ld/scripttempl/ft32.sc
+++ b/ld/scripttempl/ft32.sc
@@ -14,13 +14,12 @@ OUTPUT_FORMAT("${OUTPUT_FORMAT}")
 OUTPUT_ARCH(${ARCH})
 ${LIB_SEARCH_DIRS}
 
-PROVIDE( __PMSIZE = 256K );
-PROVIDE( __RAMSIZE = 64K );
-
 MEMORY
 {
-  flash     (rx)   : ORIGIN = 0, LENGTH = __PMSIZE
-  ram       (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE
+  /* Note - we cannot use "PROVIDE(len)" ... "LENGTH = len" as
+     PROVIDE statements are not evaluated inside MEMORY blocks.  */
+  flash     (rx)   : ORIGIN = 0, LENGTH = 256K
+  ram       (rw!x) : ORIGIN = 0x800000, LENGTH = 64K
 }
 SECTIONS
 {
@@ -35,14 +34,14 @@ SECTIONS
     . = ALIGN(4);
   } ${RELOCATING+ > flash}
   ${CONSTRUCTING+${TORS}}
-  .data	  : AT (ADDR (.text) + SIZEOF (.text))
+  .data	: ${RELOCATING+ AT (ADDR (.text) + SIZEOF (.text))}
   {
     *(.data)
     *(.rodata)
     *(.rodata*)
     ${RELOCATING+ _edata = . ; }
   } ${RELOCATING+ > ram}
-  .bss  SIZEOF(.data) + ADDR(.data) :
+  .bss  ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
   {
     ${RELOCATING+ _bss_start = . ; }
     *(.bss)
@@ -61,5 +60,10 @@ SECTIONS
   {
     *(.stabstr)
   }
+EOF
+
+. $srcdir/scripttempl/DWARF.sc
+
+cat <<EOF
 }
 EOF
diff --git a/ld/testsuite/ld-elf/compressed1d.d b/ld/testsuite/ld-elf/compressed1d.d
index 496557d..11d39b7 100644
--- a/ld/testsuite/ld-elf/compressed1d.d
+++ b/ld/testsuite/ld-elf/compressed1d.d
@@ -2,7 +2,7 @@
 #as: --compress-debug-sections=none
 #ld: -r --compress-debug-sections=zlib-gnu
 #readelf: -SW
-#notarget: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-* i370-*-* i860-*-* iq2000-*-* mn10200-*-* moxie-*-* msp430-*-* mt-*-* or1k-*-* pj-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-* ft32-*-* i370-*-* i860-*-* iq2000-*-* mn10200-*-* moxie-*-* msp430-*-* mt-*-* or1k-*-* pj-*-*
 # Not all ELF targets use the elf.em emulation...
 
 #failif
diff --git a/ld/testsuite/ld-elf/init-fini-arrays.d b/ld/testsuite/ld-elf/init-fini-arrays.d
index 46b536c..9729518 100644
--- a/ld/testsuite/ld-elf/init-fini-arrays.d
+++ b/ld/testsuite/ld-elf/init-fini-arrays.d
@@ -1,9 +1,9 @@
 #source: init-fini-arrays.s
 #ld: -r
 #readelf: -S --wide
-#xfail: cr16-*-* crx-*-* msp430-*-*
+#xfail: cr16-*-* crx-*-* ft32-*-* msp430-*-*
 # msp430 puts the init_array and fini_array inside the .rodata section.
-# cr16 and crx use non-standard scripts with memory regions, which don't play
+# cr16, crx and ft32 use non-standard scripts with memory regions, which don't play
 #  well with unique group sections under ld -r.
 
 #...
diff --git a/ld/testsuite/ld-elf/merge.d b/ld/testsuite/ld-elf/merge.d
index 7c1e4f0..f3ed882 100644
--- a/ld/testsuite/ld-elf/merge.d
+++ b/ld/testsuite/ld-elf/merge.d
@@ -6,7 +6,7 @@
 #xfail: "i370-*-*" "i860-*-*" "i960-*-*" "ip2k-*-*" "iq2000-*-*" "lm32-*-*"
 #xfail: "mcore-*-*" "mn102*-*-*" "ms1-*-*" "mep-*-*"
 #xfail: "or32-*-*" "pj-*-*" "sparc*-*-*" "tic6x-*-*" "vax-*-*" "xstormy16-*-*"
-#xfail: "xtensa*-*-*" "metag-*-*"
+#xfail: "xtensa*-*-*" "metag-*-*" "ft32-*-*"
 
 .*:     file format .*elf.*
 
diff --git a/ld/testsuite/ld-elf/orphan-region.d b/ld/testsuite/ld-elf/orphan-region.d
index 8fe6711..a74caf7 100644
--- a/ld/testsuite/ld-elf/orphan-region.d
+++ b/ld/testsuite/ld-elf/orphan-region.d
@@ -1,7 +1,7 @@
 #source: orphan-region.s
 #ld: -T orphan-region.ld -N -z stack-size=0
 #readelf: -S -l --wide
-#xfail: d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: d30v-*-* dlx-*-* fr30-*-* frv-*-elf ft32-*-* i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 #xfail: spu-*-* hppa*64*-*-* *-*-nacl*
 # if not using elf32.em, you don't get fancy orphan handling
diff --git a/ld/testsuite/ld-elf/orphan.d b/ld/testsuite/ld-elf/orphan.d
index 1af4869..d03281e 100644
--- a/ld/testsuite/ld-elf/orphan.d
+++ b/ld/testsuite/ld-elf/orphan.d
@@ -1,7 +1,7 @@
 #source: orphan.s
 #ld: -T orphan.ld
 #readelf: -S --wide
-#xfail: d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: d30v-*-* dlx-*-* fr30-*-* frv-*-elf ft32-*-* i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy orphan handling
 
diff --git a/ld/testsuite/ld-elf/orphan3.d b/ld/testsuite/ld-elf/orphan3.d
index c098e1b..3331e3f 100644
--- a/ld/testsuite/ld-elf/orphan3.d
+++ b/ld/testsuite/ld-elf/orphan3.d
@@ -6,7 +6,7 @@
 #source: orphan3f.s
 #ld:
 #readelf: -S --wide
-#xfail: "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-elf"
+#xfail: "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-elf" "ft32-*-*"
 #xfail: "i860-*-*" "i960-*-*" "iq2000-*-*" "mn10200-*-*" "msp430-*-*" "mt-*-*"
 #xfail: "pj-*-*"
 #xfail: "xstormy16-*-*"
diff --git a/ld/testsuite/ld-elf/pr349.d b/ld/testsuite/ld-elf/pr349.d
index 7c4ff73..565e387 100644
--- a/ld/testsuite/ld-elf/pr349.d
+++ b/ld/testsuite/ld-elf/pr349.d
@@ -2,7 +2,7 @@
 #source: pr349-2.s
 #ld: -r
 #readelf: -S
-#xfail: d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: d30v-*-* dlx-*-* fr30-*-* frv-*-elf ft32-*-* i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy section handling
 
diff --git a/ld/testsuite/ld-elf/sec-to-seg.exp b/ld/testsuite/ld-elf/sec-to-seg.exp
index 51c3bde..8847318 100644
--- a/ld/testsuite/ld-elf/sec-to-seg.exp
+++ b/ld/testsuite/ld-elf/sec-to-seg.exp
@@ -78,6 +78,7 @@ if {    [istarget avr-*-*]
      || [istarget cr16-*-*]
      || [istarget crx-*-*]
      || [istarget dlx-*-*]
+     || [istarget ft32-*-*]
      || [istarget h8300-*-*]
      || [istarget i960-*-*]
      || [istarget ip2k-*-*]
diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/sec64k.exp
index b0e49ea..b089fb8 100644
--- a/ld/testsuite/ld-elf/sec64k.exp
+++ b/ld/testsuite/ld-elf/sec64k.exp
@@ -40,8 +40,10 @@ if { [istarget "arc*-*-*"]
     return
 }
 
-# m68hc11, m68hc12 and xgate run out of address space.
-if { [istarget "m68hc1*-*"] || [istarget "xgate-*"] } {
+# ft32, m68hc11, m68hc12 and xgate run out of address space.
+if {   [istarget "ft32-*-*"]
+    || [istarget "m68hc1*-*"]
+    || [istarget "xgate-*"] } {
     return
 }
 
diff --git a/ld/testsuite/ld-elf/warn2.d b/ld/testsuite/ld-elf/warn2.d
index 8b3f4a0..cfeb8ce 100644
--- a/ld/testsuite/ld-elf/warn2.d
+++ b/ld/testsuite/ld-elf/warn2.d
@@ -5,7 +5,7 @@
 #warning: ^[^\\n]*\.[obj]+: warning: function 'Foo' used$
 #readelf: -s
 #notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"
-#xfail: d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: d30v-*-* dlx-*-* fr30-*-* frv-*-elf ft32-*-* i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy section handling
 
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index d2ece76..07ed747 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1719,6 +1719,7 @@ proc check_shared_lib_support { } {
 	 && ![istarget dlx-*-*]
 	 && ![istarget epiphany-*-*]
 	 && ![istarget fr30-*-*]
+	 && ![istarget ft32-*-*]
 	 && ![istarget frv-*-*]
 	 && ![istarget h8300-*-*]
 	 && ![istarget i860-*-*]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]