public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] Revert "arc: Add new linker emulation and scripts for ARCv3 ISA."
@ 2023-09-25 14:08 Claudiu Zissulescu
  0 siblings, 0 replies; only message in thread
From: Claudiu Zissulescu @ 2023-09-25 14:08 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7f2b40892ac65feddf8d532548f0fff0af01a3e9

commit 7f2b40892ac65feddf8d532548f0fff0af01a3e9
Author: Claudiu Zissulescu <claziss@gmail.com>
Date:   Mon Sep 25 17:02:55 2023 +0300

    Revert "arc: Add new linker emulation and scripts for ARCv3 ISA."
    
    This reverts commit 4deb1ee57fdb711cac6f36fed75b3c8cb5112d99.

Diff:
---
 ld/Makefile.am                 |  4 ----
 ld/Makefile.in                 |  8 --------
 ld/configure.tgt               | 21 ++-------------------
 ld/emulparams/arc64elf32.sh    | 12 ------------
 ld/emulparams/arc64elf64.sh    | 12 ------------
 ld/emulparams/arc64linux32.sh  | 22 ----------------------
 ld/emulparams/arc64linux64.sh  | 22 ----------------------
 ld/scripttempl/elfarc.sc       | 18 ++++++++++++++----
 ld/testsuite/ld-arc/got-weak.d | 12 ++++++++++++
 ld/testsuite/ld-arc/got-weak.s |  7 +++++++
 10 files changed, 35 insertions(+), 103 deletions(-)

diff --git a/ld/Makefile.am b/ld/Makefile.am
index 1efb1726f65..9664d4c7709 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -391,10 +391,6 @@ ALL_64_EMULATION_SOURCES = \
 	eaarch64nto.c \
 	eaarch64pe.c \
 	earm64pe.c \
-	earc64elf32.c \
-	earc64elf64.c \
-	earc64linux32.c \
-	earc64linux64.c \
 	eelf32_x86_64.c \
 	eelf32b4300.c \
 	eelf32bmip.c \
diff --git a/ld/Makefile.in b/ld/Makefile.in
index ce2fb16ec83..afd22d479ec 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -890,10 +890,6 @@ ALL_64_EMULATION_SOURCES = \
 	eaarch64nto.c \
 	eaarch64pe.c \
 	earm64pe.c \
-	earc64elf32.c \
-	earc64elf64.c \
-	earc64linux32.c \
-	earc64linux64.c \
 	eelf32_x86_64.c \
 	eelf32b4300.c \
 	eelf32bmip.c \
@@ -1283,10 +1279,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaixrs6.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ealpha.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ealphavms.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earc64elf32.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earc64elf64.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earc64linux32.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earc64linux64.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earcelf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earclinux_nps.Po@am__quote@
diff --git a/ld/configure.tgt b/ld/configure.tgt
index d69dee8c355..ff0aaaae257 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -153,27 +153,10 @@ alpha*-*-*vms*)		targ_emul=alphavms
 			;;
 am33_2.0-*-linux*)	targ_emul=elf32am33lin # mn10300 variant
 			;;
-arc-*-elf* | arc[be]*-*-elf*)	targ_emul=arcelf
+arc*-*-elf*)		targ_emul=arcelf
 			targ_extra_emuls="arclinux arclinux_nps arcv2elf arcv2elfx"
 			;;
-arc64-*-elf*)		targ_emul=arc64elf64
-			targ_extra_emuls="arc64elf32 arc64linux64 arc64linux32"
-			targ_extra_libpath=$targ_extra_emuls
-			;;
-arc32-*-elf*)		targ_emul=arc64elf32
-			targ_extra_emuls="arc64linux32 arc64elf64 arc64linux64"
-			targ_extra_libpath=$targ_extra_emuls
-			;;
-arc64-*-linux*)		targ_emul=arc64linux64
-			targ_extra_emuls="arc64elf64 arc64elf32 arc64linux32"
-			targ_extra_libpath=$targ_extra_emuls
-			;;
-arc32-*-linux*)		targ_emul=arc64linux32
-			targ_extra_emuls="arc64elf32 arc64elf64 arc64linux64"
-			targ_extra_libpath=$targ_extra_emuls
-			;;
-arc-*-linux* | arc[eb]*-linux*)
-			case "${with_cpu}" in
+arc*-*-linux*)		case "${with_cpu}" in
 			nps400)	targ_emul=arclinux_nps
 				targ_extra_emuls=arclinux
 				;;
diff --git a/ld/emulparams/arc64elf32.sh b/ld/emulparams/arc64elf32.sh
deleted file mode 100644
index 0f8389a0a6f..00000000000
--- a/ld/emulparams/arc64elf32.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-SCRIPT_NAME=elf
-ELFSIZE=32
-SCRIPT_NAME=elfarc
-TEMPLATE_NAME=elf
-OUTPUT_FORMAT="elf32-littlearc64"
-
-TEXT_START_ADDR=0x00
-
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-ARCH="arc64:32"
-ENTRY=__start
-EMBEDDED=yes
diff --git a/ld/emulparams/arc64elf64.sh b/ld/emulparams/arc64elf64.sh
deleted file mode 100644
index d4291345206..00000000000
--- a/ld/emulparams/arc64elf64.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-SCRIPT_NAME=elf
-ELFSIZE=64
-SCRIPT_NAME=elfarc
-TEMPLATE_NAME=elf
-OUTPUT_FORMAT="elf64-littlearc64"
-
-TEXT_START_ADDR=0x00
-
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-ARCH="arc64:64"
-ENTRY=__start
-EMBEDDED=yes
diff --git a/ld/emulparams/arc64linux32.sh b/ld/emulparams/arc64linux32.sh
deleted file mode 100644
index 1ad8f3de41e..00000000000
--- a/ld/emulparams/arc64linux32.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-ARCH="arc64:32"
-
-SCRIPT_NAME=elf
-ELFSIZE=32
-OUTPUT_FORMAT="elf32-littlearc64"
-
-TEMPLATE_NAME=elf
-
-GENERATE_SHLIB_SCRIPT=yes
-GENERATE_PIE_SCRIPT=yes
-
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-
-TEXT_START_ADDR=0x10000
-
-ENTRY=__start
-
-# To support RELRO security feature.
-NO_SMALL_DATA=yes
-SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0"
-GENERATE_COMBRELOC_SCRIPT=yes
diff --git a/ld/emulparams/arc64linux64.sh b/ld/emulparams/arc64linux64.sh
deleted file mode 100644
index 89ff73dc4f2..00000000000
--- a/ld/emulparams/arc64linux64.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-ARCH="arc64:64"
-
-SCRIPT_NAME=elf
-ELFSIZE=64
-OUTPUT_FORMAT="elf64-littlearc64"
-
-TEMPLATE_NAME=elf
-
-GENERATE_SHLIB_SCRIPT=yes
-GENERATE_PIE_SCRIPT=yes
-
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-
-TEXT_START_ADDR=0x10000
-
-ENTRY=__start
-
-# To support RELRO security feature.
-NO_SMALL_DATA=yes
-SEPARATE_GOTPLT=8 #FIXME! what is the true value here?
-GENERATE_COMBRELOC_SCRIPT=yes
diff --git a/ld/scripttempl/elfarc.sc b/ld/scripttempl/elfarc.sc
index 78cb0fa9540..1ae0248a900 100644
--- a/ld/scripttempl/elfarc.sc
+++ b/ld/scripttempl/elfarc.sc
@@ -394,10 +394,20 @@ test -n "${RELOCATING}" && cat <<EOF
      The options appear in the wrong order to do this with a single symbol -
      ldflags comes after flags injected with per-file stanzas, and thus
      the setting from ldflags prevails.  */
-  ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-  ${RELOCATING+ PROVIDE (__start_heap = .) ; }
-  ${RELOCATING+ PROVIDE (__stack_top = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_HEAP_SIZE) ? __DEFAULT_HEAP_SIZE : 20k)) + (DEFINED(__STACK_SIZE) ? __STACK_SIZE : 64k));}
-  ${RELOCATING+ PROVIDE (__end_heap = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_STACK_SIZE) ? __DEFAULT_STACK_SIZE : 20k)));}
+  .heap :
+  {
+	__start_heap = . ;
+	. = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_HEAP_SIZE) ? __DEFAULT_HEAP_SIZE : 20k)) ;
+	__end_heap = . ;
+  }
+
+  . = ALIGN(0x8);
+  .stack :
+  {
+	__stack = . ;
+	. = . + (DEFINED(__STACK_SIZE) ? __STACK_SIZE : (DEFINED(__DEFAULT_STACK_SIZE) ? __DEFAULT_STACK_SIZE : 64k)) ;
+	__stack_top = . ;
+  }
 EOF
 
 source_sh $srcdir/scripttempl/misc-sections.sc
diff --git a/ld/testsuite/ld-arc/got-weak.d b/ld/testsuite/ld-arc/got-weak.d
new file mode 100644
index 00000000000..a7f5b2fa119
--- /dev/null
+++ b/ld/testsuite/ld-arc/got-weak.d
@@ -0,0 +1,12 @@
+#source: got-weak.s
+#as:
+#ld: -Bstatic
+#objdump: -d
+
+[^:]*:\s+file format elf32-.*arc
+
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <.*>:
+^\s+[0-9a-f]+:\s+2730\s7f80\s[0-9a-f]+\s[0-9a-f]+\s+ld\s+r\d+,\[pcl,.*
diff --git a/ld/testsuite/ld-arc/got-weak.s b/ld/testsuite/ld-arc/got-weak.s
new file mode 100644
index 00000000000..8ea18be3780
--- /dev/null
+++ b/ld/testsuite/ld-arc/got-weak.s
@@ -0,0 +1,7 @@
+	.cpu archs
+
+	.weak symb
+	.global __start
+	.text
+__start:
+	ld	r0,[pcl,@symb@gotpc]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-25 14:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25 14:08 [binutils-gdb] Revert "arc: Add new linker emulation and scripts for ARCv3 ISA." Claudiu Zissulescu

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