mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-13 10:55:46 +08:00
* elf32-spu.c (struct spu_link_hash_table): Remove overlay_fixed,
reserved, and extra_stack_space members. (spu_elf_auto_overlay): Use auto_overlay_fixed, auto_overlay_reserved, and extra_stack_space members of htab->params instead.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2009-11-17 Ulrich Weigand <uweigand@de.ibm.com>
|
||||||
|
|
||||||
|
* elf32-spu.c (struct spu_link_hash_table): Remove overlay_fixed,
|
||||||
|
reserved, and extra_stack_space members.
|
||||||
|
(spu_elf_auto_overlay): Use auto_overlay_fixed, auto_overlay_reserved,
|
||||||
|
and extra_stack_space members of htab->params instead.
|
||||||
|
|
||||||
2009-11-17 Tristan Gingold <gingold@adacore.com>
|
2009-11-17 Tristan Gingold <gingold@adacore.com>
|
||||||
|
|
||||||
* targets.c: Include alloca-conf.h
|
* targets.c: Include alloca-conf.h
|
||||||
|
@ -331,16 +331,7 @@ struct spu_link_hash_table
|
|||||||
|
|
||||||
/* How much memory we have. */
|
/* How much memory we have. */
|
||||||
unsigned int local_store;
|
unsigned int local_store;
|
||||||
/* Local store --auto-overlay should reserve for non-overlay
|
|
||||||
functions and data. */
|
|
||||||
unsigned int overlay_fixed;
|
|
||||||
/* Local store --auto-overlay should reserve for stack and heap. */
|
|
||||||
unsigned int reserved;
|
|
||||||
/* If reserved is not specified, stack analysis will calculate a value
|
|
||||||
for the stack. This parameter adjusts that value to allow for
|
|
||||||
negative sp access (the ABI says 2000 bytes below sp are valid,
|
|
||||||
and the overlay manager uses some of this area). */
|
|
||||||
int extra_stack_space;
|
|
||||||
/* Count of overlay stubs needed in non-overlay area. */
|
/* Count of overlay stubs needed in non-overlay area. */
|
||||||
unsigned int non_ovly_stub;
|
unsigned int non_ovly_stub;
|
||||||
|
|
||||||
@ -4163,6 +4154,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
|
|||||||
bfd **bfd_arr;
|
bfd **bfd_arr;
|
||||||
struct elf_segment_map *m;
|
struct elf_segment_map *m;
|
||||||
unsigned int fixed_size, lo, hi;
|
unsigned int fixed_size, lo, hi;
|
||||||
|
unsigned int reserved;
|
||||||
struct spu_link_hash_table *htab;
|
struct spu_link_hash_table *htab;
|
||||||
unsigned int base, i, count, bfd_count;
|
unsigned int base, i, count, bfd_count;
|
||||||
unsigned int region, ovlynum;
|
unsigned int region, ovlynum;
|
||||||
@ -4198,7 +4190,8 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
|
|||||||
goto err_exit;
|
goto err_exit;
|
||||||
|
|
||||||
htab = spu_hash_table (info);
|
htab = spu_hash_table (info);
|
||||||
if (htab->reserved == 0)
|
reserved = htab->params->auto_overlay_reserved;
|
||||||
|
if (reserved == 0)
|
||||||
{
|
{
|
||||||
struct _sum_stack_param sum_stack_param;
|
struct _sum_stack_param sum_stack_param;
|
||||||
|
|
||||||
@ -4206,11 +4199,12 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
|
|||||||
sum_stack_param.overall_stack = 0;
|
sum_stack_param.overall_stack = 0;
|
||||||
if (!for_each_node (sum_stack, info, &sum_stack_param, TRUE))
|
if (!for_each_node (sum_stack, info, &sum_stack_param, TRUE))
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
htab->reserved = sum_stack_param.overall_stack + htab->extra_stack_space;
|
reserved = (sum_stack_param.overall_stack
|
||||||
|
+ htab->params->extra_stack_space);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No need for overlays if everything already fits. */
|
/* No need for overlays if everything already fits. */
|
||||||
if (fixed_size + htab->reserved <= htab->local_store
|
if (fixed_size + reserved <= htab->local_store
|
||||||
&& htab->params->ovly_flavour != ovly_soft_icache)
|
&& htab->params->ovly_flavour != ovly_soft_icache)
|
||||||
{
|
{
|
||||||
htab->params->auto_overlay = 0;
|
htab->params->auto_overlay = 0;
|
||||||
@ -4323,7 +4317,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
|
|||||||
}
|
}
|
||||||
free (bfd_arr);
|
free (bfd_arr);
|
||||||
|
|
||||||
fixed_size += htab->reserved;
|
fixed_size += reserved;
|
||||||
fixed_size += htab->non_ovly_stub * ovl_stub_size (htab->params);
|
fixed_size += htab->non_ovly_stub * ovl_stub_size (htab->params);
|
||||||
if (fixed_size + mos_param.max_overlay_size <= htab->local_store)
|
if (fixed_size + mos_param.max_overlay_size <= htab->local_store)
|
||||||
{
|
{
|
||||||
@ -4362,13 +4356,13 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
|
|||||||
(bfd_vma) mos_param.max_overlay_size);
|
(bfd_vma) mos_param.max_overlay_size);
|
||||||
|
|
||||||
/* Now see if we should put some functions in the non-overlay area. */
|
/* Now see if we should put some functions in the non-overlay area. */
|
||||||
else if (fixed_size < htab->overlay_fixed)
|
else if (fixed_size < htab->params->auto_overlay_fixed)
|
||||||
{
|
{
|
||||||
unsigned int max_fixed, lib_size;
|
unsigned int max_fixed, lib_size;
|
||||||
|
|
||||||
max_fixed = htab->local_store - mos_param.max_overlay_size;
|
max_fixed = htab->local_store - mos_param.max_overlay_size;
|
||||||
if (max_fixed > htab->overlay_fixed)
|
if (max_fixed > htab->params->auto_overlay_fixed)
|
||||||
max_fixed = htab->overlay_fixed;
|
max_fixed = htab->params->auto_overlay_fixed;
|
||||||
lib_size = max_fixed - fixed_size;
|
lib_size = max_fixed - fixed_size;
|
||||||
lib_size = auto_ovl_lib_functions (info, lib_size);
|
lib_size = auto_ovl_lib_functions (info, lib_size);
|
||||||
if (lib_size == (unsigned int) -1)
|
if (lib_size == (unsigned int) -1)
|
||||||
|
Reference in New Issue
Block a user