}
else
{
- link = (struct pending *) xmalloc (sizeof (struct pending));
+ link = XNEW (struct pending);
}
link->next = *listhead;
file). Put the block on the list of pending blocks. */
static struct block *
-finish_block_internal (struct symbol *symbol, struct pending **listhead,
+finish_block_internal (struct symbol *symbol,
+ struct pending **listhead,
struct pending_block *old_blocks,
+ const struct dynamic_prop *static_link,
CORE_ADDR start, CORE_ADDR end,
int is_global, int expandable)
{
BLOCK_FUNCTION (block) = NULL;
}
+ if (static_link != NULL)
+ objfile_register_static_link (objfile, block, static_link);
+
/* Now "free" the links of the list, and empty the list. */
for (next = *listhead; next; next = next1)
}
struct block *
-finish_block (struct symbol *symbol, struct pending **listhead,
+finish_block (struct symbol *symbol,
+ struct pending **listhead,
struct pending_block *old_blocks,
+ const struct dynamic_prop *static_link,
CORE_ADDR start, CORE_ADDR end)
{
- return finish_block_internal (symbol, listhead, old_blocks,
+ return finish_block_internal (symbol, listhead, old_blocks, static_link,
start, end, 0, 0);
}
if (pending_blocks == NULL)
obstack_init (&pending_block_obstack);
- pblock = (struct pending_block *)
- obstack_alloc (&pending_block_obstack, sizeof (struct pending_block));
+ pblock = XOBNEW (&pending_block_obstack, struct pending_block);
pblock->block = block;
if (opblock)
{
/* This subfile is not known. Add an entry for it. */
- subfile = (struct subfile *) xmalloc (sizeof (struct subfile));
+ subfile = XNEW (struct subfile);
memset (subfile, 0, sizeof (struct subfile));
subfile->buildsym_compunit = buildsym_compunit;
{
struct buildsym_compunit *bscu;
- bscu = (struct buildsym_compunit *)
- xmalloc (sizeof (struct buildsym_compunit));
+ bscu = XNEW (struct buildsym_compunit);
memset (bscu, 0, sizeof (struct buildsym_compunit));
bscu->objfile = objfile;
void
push_subfile (void)
{
- struct subfile_stack *tem
- = (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack));
+ struct subfile_stack *tem = XNEW (struct subfile_stack);
tem->next = subfile_stack;
subfile_stack = tem;
struct context_stack *cstk = pop_context ();
/* Make a block for the local symbols within. */
- finish_block (cstk->name, &local_symbols, cstk->old_blocks,
+ finish_block (cstk->name, &local_symbols, cstk->old_blocks, NULL,
cstk->start_addr, end_addr);
if (context_stack_depth > 0)
for (pb = pending_blocks; pb != NULL; pb = pb->next)
count++;
- barray = xmalloc (sizeof (*barray) * count);
+ barray = XNEWVEC (struct block *, count);
back_to = make_cleanup (xfree, barray);
bp = barray;
else
{
/* Define the STATIC_BLOCK. */
- return finish_block_internal (NULL, &file_symbols, NULL,
+ return finish_block_internal (NULL, &file_symbols, NULL, NULL,
last_source_start_addr, end_addr,
0, expandable);
}
end_addr = BLOCK_END (static_block);
/* Create the GLOBAL_BLOCK and build the blockvector. */
- finish_block_internal (NULL, &global_symbols, NULL,
+ finish_block_internal (NULL, &global_symbols, NULL, NULL,
last_source_start_addr, end_addr,
1, expandable);
blockvector = make_blockvector ();
if (context_stack == NULL)
{
context_stack_size = INITIAL_CONTEXT_STACK_SIZE;
- context_stack = (struct context_stack *)
- xmalloc (context_stack_size * sizeof (struct context_stack));
+ context_stack = XNEWVEC (struct context_stack, context_stack_size);
}
/* Ensure the really_free_pendings cleanup was called after