aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-12-10 03:49:02 +0000
committerAlan Modra <amodra@gmail.com>2008-12-10 03:49:02 +0000
commitb0c4170911beec5bdad9a622b8ae8053a8dcc55e (patch)
tree6af12d0ee565574f9445034e1cb4a55daf76435e /bfd
parentb05dcbb7f97fb8e8b1449a6bde96761b3cb3e39b (diff)
downloadfsf-binutils-gdb-b0c4170911beec5bdad9a622b8ae8053a8dcc55e.zip
fsf-binutils-gdb-b0c4170911beec5bdad9a622b8ae8053a8dcc55e.tar.gz
fsf-binutils-gdb-b0c4170911beec5bdad9a622b8ae8053a8dcc55e.tar.bz2
* elf32-spu.c (define_ovtab_symbol): Don't abort on symbols
defined in linker scripts. (discover_functions): Consider STT_SECTION symbols too. (collect_lib_sections): Don't cut short call tree traversal when function size is too large.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf32-spu.c32
2 files changed, 24 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6b4e40b..17f1fb4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -5,6 +5,10 @@
(mark_detached_root): New function.
(build_call_tree): Call it.
(sort_calls): Don't do void* arithmetic.
+ (define_ovtab_symbol): Don't abort on symbols defined in linker scripts.
+ (discover_functions): Consider STT_SECTION symbols too.
+ (collect_lib_sections): Don't cut short call tree traversal
+ when function size is too large.
2008-12-09 Tom Tromey <tromey@redhat.com>
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index 48a4a3c..b2ac17e 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -1401,7 +1401,7 @@ define_ovtab_symbol (struct spu_link_hash_table *htab, const char *name)
h->ref_regular_nonweak = 1;
h->non_elf = 0;
}
- else
+ else if (h->root.u.def.section->owner != NULL)
{
(*_bfd_error_handler) (_("%B is not allowed to define %s"),
h->root.u.def.section->owner,
@@ -1409,6 +1409,13 @@ define_ovtab_symbol (struct spu_link_hash_table *htab, const char *name)
bfd_set_error (bfd_error_bad_value);
return NULL;
}
+ else
+ {
+ (*_bfd_error_handler) (_("you are not allowed to define %s in a script"),
+ h->root.root.string);
+ bfd_set_error (bfd_error_bad_value);
+ return NULL;
+ }
return h;
}
@@ -2434,7 +2441,8 @@ discover_functions (struct bfd_link_info *info)
sec_arr[bfd_idx] = psecs;
for (psy = psyms, p = psecs, sy = syms; sy < syms + symcount; ++p, ++sy)
if (ELF_ST_TYPE (sy->st_info) == STT_NOTYPE
- || ELF_ST_TYPE (sy->st_info) == STT_FUNC)
+ || ELF_ST_TYPE (sy->st_info) == STT_FUNC
+ || ELF_ST_TYPE (sy->st_info) == STT_SECTION)
{
asection *s;
@@ -3047,18 +3055,18 @@ collect_lib_sections (struct function_info *fun,
size = fun->sec->size;
if (fun->rodata)
size += fun->rodata->size;
- if (size > lib_param->lib_size)
- return TRUE;
-
- *lib_param->lib_sections++ = fun->sec;
- fun->sec->gc_mark = 0;
- if (fun->rodata && fun->rodata->linker_mark && fun->rodata->gc_mark)
+ if (size <= lib_param->lib_size)
{
- *lib_param->lib_sections++ = fun->rodata;
- fun->rodata->gc_mark = 0;
+ *lib_param->lib_sections++ = fun->sec;
+ fun->sec->gc_mark = 0;
+ if (fun->rodata && fun->rodata->linker_mark && fun->rodata->gc_mark)
+ {
+ *lib_param->lib_sections++ = fun->rodata;
+ fun->rodata->gc_mark = 0;
+ }
+ else
+ *lib_param->lib_sections++ = NULL;
}
- else
- *lib_param->lib_sections++ = NULL;
for (call = fun->call_list; call != NULL; call = call->next)
collect_lib_sections (call->fun, info, param);