aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-03-17 12:46:19 +0000
committerAlan Modra <amodra@gmail.com>2009-03-17 12:46:19 +0000
commita7e11ee1d2e57a66740e940cb511ddba421fac47 (patch)
treecbf7e7c6bf82272b80cd8bbcb3f1f0d208e06726 /ld
parent9efe6174dc55b401321d1b53cdd04888e470b4c2 (diff)
downloadfsf-binutils-gdb-a7e11ee1d2e57a66740e940cb511ddba421fac47.zip
fsf-binutils-gdb-a7e11ee1d2e57a66740e940cb511ddba421fac47.tar.gz
fsf-binutils-gdb-a7e11ee1d2e57a66740e940cb511ddba421fac47.tar.bz2
bfd/
* elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit. Add compact_stub. (emum _ovly_flavour): Delete ovly_compact, ovly_none. * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and ovly_return fields with ovly_entry[2]. Adjust all users. (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler when soft-icache. (spu_elf_build_stubs): Likewise. (ovl_stub_size): Change arg to spu_elf_params pointer. Adjust for ovly_flavour changes. Update all callers. (ovl_stub_size_log2): New function. (build_stub): Handle compact icache stubs. Use different manager entry point for stubs in non-icache area. (spu_elf_size_stubs): Don't allocate space for indirect branch descriptors. (spu_elf_build_stubs): And don't built them. ld/ * emultempl/spu_icache.S: Add new entry to dummy handler. * emultempl/spu_icache.o_c: Regenerate. * emultempl/spuelf.em (params): Init new field. (no_overlays): New static var. (spu_before_allocation): Use it. (OPTION_SPU_COMPACT_STUBS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add compact-stubs. (PARSE_AND_LIST_ARGS_CASES): Handle compact-stubs. Adjust no-overlays handling. ld/testsuite/ * ld-spu/icache1.d: Update for fixed set_id, new manager entry, and reduced data.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog12
-rw-r--r--ld/emultempl/spu_icache.S3
-rw-r--r--ld/emultempl/spu_icache.o_c56
-rw-r--r--ld/emultempl/spuelf.em18
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-spu/icache1.d32
6 files changed, 78 insertions, 48 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7937748..c9157f2 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,17 @@
2009-03-17 Alan Modra <amodra@bigpond.net.au>
+ * emultempl/spu_icache.S: Add new entry to dummy handler.
+ * emultempl/spu_icache.o_c: Regenerate.
+ * emultempl/spuelf.em (params): Init new field.
+ (no_overlays): New static var.
+ (spu_before_allocation): Use it.
+ (OPTION_SPU_COMPACT_STUBS): Define.
+ (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add compact-stubs.
+ (PARSE_AND_LIST_ARGS_CASES): Handle compact-stubs. Adjust no-overlays
+ handling.
+
+2009-03-17 Alan Modra <amodra@bigpond.net.au>
+
* configure.host (HOSTING_LIBS): Two dollars on shell variable
expansion to suit make.
diff --git a/ld/emultempl/spu_icache.S b/ld/emultempl/spu_icache.S
index be7d523..12eb7f1 100644
--- a/ld/emultempl/spu_icache.S
+++ b/ld/emultempl/spu_icache.S
@@ -2,3 +2,6 @@
.global __icache_br_handler
__icache_br_handler:
stop
+ .global __icache_call_handler
+__icache_call_handler:
+ stop
diff --git a/ld/emultempl/spu_icache.o_c b/ld/emultempl/spu_icache.o_c
index 267a9d9..2006fe2 100644
--- a/ld/emultempl/spu_icache.o_c
+++ b/ld/emultempl/spu_icache.o_c
@@ -1,31 +1,33 @@
0x7f,0x45,0x4c,0x46,0x01,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x01,0x00,0x17,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x28,
-0x00,0x07,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x2e,0x73,0x79,0x6d,0x74,0x61,0x62,
-0x00,0x2e,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x2e,0x73,0x68,0x73,0x74,0x72,0x74,
-0x61,0x62,0x00,0x2e,0x74,0x65,0x78,0x74,0x00,0x2e,0x64,0x61,0x74,0x61,0x00,0x2e,
-0x62,0x73,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x28,
+0x00,0x07,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x73,0x79,
+0x6d,0x74,0x61,0x62,0x00,0x2e,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x2e,0x73,0x68,
+0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x2e,0x74,0x65,0x78,0x74,0x00,0x2e,0x64,0x61,
+0x74,0x61,0x00,0x2e,0x62,0x73,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,
-0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x27,
-0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
-0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x7c,
-0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,
-0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xcc,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x02,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x03,0x00,0x00,0x00,0x01,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x01,0x00,0x5f,0x5f,0x69,
-0x63,0x61,0x63,0x68,0x65,0x5f,0x62,0x72,0x5f,0x68,0x61,0x6e,0x64,0x6c,0x65,0x72,
-0x00,
+0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x01,
+0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x27,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x03,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x2c,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x04,
+0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x03,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe0,0x00,0x00,0x00,0x2b,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x01,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x02,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x03,
+0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x01,
+0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x01,
+0x00,0x5f,0x5f,0x69,0x63,0x61,0x63,0x68,0x65,0x5f,0x62,0x72,0x5f,0x68,0x61,0x6e,
+0x64,0x6c,0x65,0x72,0x00,0x5f,0x5f,0x69,0x63,0x61,0x63,0x68,0x65,0x5f,0x63,0x61,
+0x6c,0x6c,0x5f,0x68,0x61,0x6e,0x64,0x6c,0x65,0x72,0x00,
diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
index 396fe80..02b5499 100644
--- a/ld/emultempl/spuelf.em
+++ b/ld/emultempl/spuelf.em
@@ -37,11 +37,12 @@ static struct spu_elf_params params =
&spu_elf_load_ovl_mgr,
&spu_elf_open_overlay_script,
&spu_elf_relink,
- 0, ovly_normal, 0, 0, 0, 0, 0, 0,
+ 0, ovly_normal, 0, 0, 0, 0, 0, 0, 0,
0, 0x3ffff,
1, 0, 16, 0, 0, 2000
};
-
+
+static unsigned int no_overlays = 0;
static unsigned int num_lines_set = 0;
static unsigned int line_size_set = 0;
static char *auto_overlay_file = 0;
@@ -263,7 +264,7 @@ spu_before_allocation (void)
{
if (is_spu_target ()
&& !link_info.relocatable
- && params.ovly_flavour != ovly_none)
+ && !no_overlays)
{
/* Size the sections. This is premature, but we need to know the
rough layout so that overlays can be found. */
@@ -584,7 +585,8 @@ fi
PARSE_AND_LIST_PROLOGUE='
#define OPTION_SPU_PLUGIN 301
#define OPTION_SPU_NO_OVERLAYS (OPTION_SPU_PLUGIN + 1)
-#define OPTION_SPU_STUB_SYMS (OPTION_SPU_NO_OVERLAYS + 1)
+#define OPTION_SPU_COMPACT_STUBS (OPTION_SPU_NO_OVERLAYS + 1)
+#define OPTION_SPU_STUB_SYMS (OPTION_SPU_COMPACT_STUBS + 1)
#define OPTION_SPU_NON_OVERLAY_STUBS (OPTION_SPU_STUB_SYMS + 1)
#define OPTION_SPU_LOCAL_STORE (OPTION_SPU_NON_OVERLAY_STUBS + 1)
#define OPTION_SPU_STACK_ANALYSIS (OPTION_SPU_LOCAL_STORE + 1)
@@ -611,6 +613,7 @@ PARSE_AND_LIST_LONGOPTS='
{ "line-size", required_argument, NULL, OPTION_SPU_LINE_SIZE },
{ "non-ia-text", no_argument, NULL, OPTION_SPU_NON_IA_TEXT },
{ "no-overlays", no_argument, NULL, OPTION_SPU_NO_OVERLAYS },
+ { "compact-stubs", no_argument, NULL, OPTION_SPU_COMPACT_STUBS },
{ "emit-stub-syms", no_argument, NULL, OPTION_SPU_STUB_SYMS },
{ "extra-overlay-stubs", no_argument, NULL, OPTION_SPU_NON_OVERLAY_STUBS },
{ "local-store", required_argument, NULL, OPTION_SPU_LOCAL_STORE },
@@ -631,6 +634,7 @@ PARSE_AND_LIST_OPTIONS='
fprintf (file, _("\
--plugin Make SPU plugin.\n\
--no-overlays No overlay handling.\n\
+ --compact-stubs Use smaller and possibly slower call stubs.\n\
--emit-stub-syms Add symbols on overlay call stubs.\n\
--extra-overlay-stubs Add stubs on all calls out of overlay regions.\n\
--local-store=lo:hi Valid address range.\n\
@@ -662,7 +666,11 @@ PARSE_AND_LIST_ARGS_CASES='
break;
case OPTION_SPU_NO_OVERLAYS:
- params.ovly_flavour = ovly_none;
+ no_overlays = 1;
+ break;
+
+ case OPTION_SPU_COMPACT_STUBS:
+ params.compact_stub = 1;
break;
case OPTION_SPU_STUB_SYMS:
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index b13f7a0..551509e 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2009-03-17 Alan Modra <amodra@bigpond.net.au>
+ * ld-spu/icache1.d: Update for fixed set_id, new manager entry, and
+ reduced data.
+
+2009-03-17 Alan Modra <amodra@bigpond.net.au>
+
* config/default.exp (get_link_files): Replace double dollars with
single dollars.
diff --git a/ld/testsuite/ld-spu/icache1.d b/ld/testsuite/ld-spu/icache1.d
index 1cb3879..14639e7 100644
--- a/ld/testsuite/ld-spu/icache1.d
+++ b/ld/testsuite/ld-spu/icache1.d
@@ -8,7 +8,7 @@
Disassembly of section .ovl.init:
00000800 <__icache_fileoff>:
.* 00 00 00 00.*
-.* 00 00 07 80.*
+.* 00 00 07 00.*
\.\.\.
Disassembly of section \.ovly1:
@@ -32,19 +32,19 @@ Disassembly of section \.ovly2:
.* 32 00 16 80 br fec .*
\.\.\.
fa0: 00 00 00 02.*
- fa4: 00 00 11 04.*
+ fa4: 00 04 11 04.*
fa8: a0 00 0c 10.*
fac: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
fb0: 00 00 ed 00.*
\.\.\.
fc0: 00 00 00 02.*
- fc4: 00 00 10 00.*
+ fc4: 00 04 10 00.*
fc8: a0 00 0c 14.*
fcc: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
fd0: 00 00 00 00.*
fd4: 00 00 0a 80.*
\.\.\.
- fe4: 00 00 08 00.*
+ fe4: 00 04 08 00.*
fe8: 20 00 0f 38.*
fec: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
\.\.\.
@@ -89,7 +89,7 @@ Disassembly of section \.ovly5:
.* 30 01 7d 80 bra bec .*
\.\.\.
be0: 00 00 00 03.*
- be4: 00 00 14 00.*
+ be4: 00 04 14 00.*
be8: a0 00 0b 2c.*
bec: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
\.\.\.
@@ -104,20 +104,20 @@ Disassembly of section \.ovly6:
.* 32 00 18 80 br fec .*
\.\.\.
fa0: 00 00 00 07.*
- fa4: 00 04 14 00.*
+ fa4: 00 08 14 00.*
fa8: a0 00 0c 00.*
fac: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
fb0: 00 03 75 80.*
\.\.\.
fc0: 00 00 00 07.*
- fc4: 00 04 14 00.*
+ fc4: 00 08 14 00.*
fc8: a0 00 0c 04.*
fcc: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
fd0: 00 00 00 00.*
fd4: 00 00 86 80.*
\.\.\.
fe0: 00 00 00 04.*
- fe4: 00 04 08 00.*
+ fe4: 00 08 08 00.*
fe8: 20 00 0f 28.*
fec: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
\.\.\.
@@ -140,20 +140,20 @@ Disassembly of section \.ovly7:
.* 32 00 15 00 br 13ec .*
\.\.\.
13a0: 00 00 00 03.*
- 13a4: 00 00 14 00.*
+ 13a4: 00 04 14 00.*
13a8: a0 00 10 18.*
13ac: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
\.\.\.
13b8: 00 00 0f 80.*
13bc: 00 00 00 00.*
13c0: 00 00 00 07.*
- 13c4: 00 04 14 00.*
+ 13c4: 00 08 14 00.*
13c8: a0 00 10 1c.*
13cc: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
\.\.\.
13dc: 00 00 0a 80.*
13e0: 00 00 00 05.*
- 13e4: 00 04 0c 00.*
+ 13e4: 00 08 0c 00.*
13e8: 20 00 13 44.*
13ec: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
13f0: 00 00 00 00.*
@@ -171,13 +171,13 @@ Disassembly of section \.ovly8:
.* 32 00 17 80 br 17ec .*
\.\.\.
17c0: 00 00 00 02.*
- 17c4: 00 00 11 04.*
+ 17c4: 00 04 11 04.*
17c8: a0 00 14 0c.*
17cc: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
\.\.\.
17dc: 00 00 d9 00.*
17e0: 00 00 00 06.*
- 17e4: 00 04 10 00.*
+ 17e4: 00 08 10 00.*
17e8: 20 00 17 30.*
17ec: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
17f0: 00 7f 0d 80.*
@@ -186,14 +186,14 @@ Disassembly of section \.ovly8:
Disassembly of section \.text:
00001800 <_start>:
-.* 41 00 00 03 ilhu \$3,0
+.* 41 00 02 03 ilhu \$3,4
.* 60 8a 00 03 iohl \$3,5120 # 1400
.* 32 00 04 80 br 182c.*
\.\.\.
1820: 00 00 00 01.*
- 1824: 00 00 0c 00.*
+ 1824: 00 04 0c 00.*
1828: a0 00 18 08.*
- 182c: 31 03 0a 4b brasl \$75,1850 <__icache_br_handler>
+ 182c: 31 03 0a cb brasl \$75,1854 <__icache_call_handler>
\.\.\.
1838: 00 7e 7b 80.*
\.\.\.