Sun Oct 31 00:36:40 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+ * config/tc-hppa.c (subspace_dictionary_chain): Add new ssd_defined
+ field. Define SUBSPACE_DEFINED accessor macro.
+ (pa_subspace): Allow user to override subspace attributes for
+ built-in subspaces. Set ssd_defined at the end of fcn -- that
+ way the attributes can only be changed once. Pass newly allocated
+ name to is_defined_subspace, not a pointer to the input line.
+ Fix typo in space/subspace rework.
+ (is_defined_subspace): Delete unused 2nd arg. All callers changed.
+
+ * config/tc-hppa.c (pa_import): If currently in the text segment
+ and a symbol is imported without type information, set BSF_FUNCTION
+ for the symbol.
* write.c (relax_and_size_seg): Correct test to determine if
the section's size was rounded up.
/* Index of containing space. */
unsigned long ssd_space_index;
+ /* Nonzero if this space has been defined by the user code. */
+ unsigned int ssd_defined;
+
/* Which quadrant within the space this subspace should be loaded into. */
unsigned char ssd_quadrant;
char, char, char, int,
int, int, int, subsegT));
static sd_chain_struct *is_defined_space PARAMS ((char *));
-static ssd_chain_struct *is_defined_subspace PARAMS ((char *, subsegT));
+static ssd_chain_struct *is_defined_subspace PARAMS ((char *));
static sd_chain_struct *pa_segment_to_space PARAMS ((asection *));
static ssd_chain_struct * pa_subsegment_to_subspace PARAMS ((asection *,
subsegT));
#define SPACE_NAME_INDEX(space_chain) (space_chain)->sd_name_index
#define SUBSPACE_SPACE_INDEX(ss_chain) (ss_chain)->ssd_space_index
+#define SUBSPACE_DEFINED(ss_chain) (ss_chain)->ssd_defined
#define SUBSPACE_QUADRANT(ss_chain) (ss_chain)->ssd_quadrant
#define SUBSPACE_ALIGN(ss_chain) (ss_chain)->ssd_alignment
#define SUBSPACE_ACCESS(ss_chain) (ss_chain)->ssd_access_control_bits
if (!is_end_of_statement ())
{
input_line_pointer++;
- /* Hmmm. This doesn't look right. */
pa_export_args (symbol);
}
else
{
+ /* Sigh. To be compatable with the HP assembler and to help
+ poorly written assembly code, we assign a type based on
+ the the current segment. Note only BSF_FUNCTION really
+ matters, we do not need to set the full SYMBOL_TYPE_* info here. */
+ if (now_seg == text_section)
+ symbol->bsym->flags |= BSF_FUNCTION;
+
/* If the section is undefined, then the symbol is undefined
Since this is an import, leave the section undefined. */
S_SET_SEGMENT (symbol, &bfd_und_section);
alias = NULL;
space = current_space;
- ssd = is_defined_subspace (name, space->sd_last_subseg);
- if (ssd)
+ ssd = is_defined_subspace (ss_name);
+ /* Allow user to override the builtin attributes of subspaces. But
+ only allow the attributes to be changed once! */
+ if (ssd && SUBSPACE_DEFINED (ssd))
{
subseg_set (ssd->ssd_seg, ssd->ssd_subseg);
if (!is_end_of_statement ())
but the "standard" sections for ELF. */
if (ssd)
section = ssd->ssd_seg;
- if (alias)
+ else if (alias)
section = subseg_new (alias, 0);
else if (! alias && USE_ALIASES)
{
bfd_set_section_vma (stdoutput, section,
pa_subspace_start (space, quadrant));
-
/* Now that all the flags are set, update an existing subspace,
or create a new one. */
if (ssd)
code_only, common, dup_common,
sort, zero, access, space_index,
alignment, quadrant,
- ssd->ssd_subseg);
+ section);
else
current_subspace = create_new_subspace (space, ss_name, loadable,
code_only, common,
current_subspace->ssd_seg = section;
subseg_set (current_subspace->ssd_seg, current_subspace->ssd_subseg);
}
+ SUBSPACE_DEFINED (current_subspace) = 1;
return;
}
{
ssd_chain_struct *chain_entry;
- if ((chain_entry = is_defined_subspace (name, subseg)))
+ if ((chain_entry = is_defined_subspace (name)))
{
SUBSPACE_ACCESS (chain_entry) = access;
SUBSPACE_LOADABLE (chain_entry) = loadable;
own subspace. */
static ssd_chain_struct *
-is_defined_subspace (name, subseg)
+is_defined_subspace (name)
char *name;
- subsegT subseg;
{
sd_chain_struct*space_chain;
ssd_chain_struct *subspace_chain;