+Mon Mar 6 09:53:08 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * cpu-hppa.c (arch_info_struct): Support both PA1.0 and PA1.1
+ machine types.
+ (bfd_hppa_arch): Link in both PA1.0 and PA1.1 architecture info
+ structures.
+ * libhppa.h (enum pa_arch): New enumeration to describe the
+ different variants of the PA architecture.
+ * som.c (som_object_setup): Use new enumeration to set machine
+ type.
+ (som_finish_writing): If the machine type is PA1.1, then use the
+ PA1.1 machine identifier in the output file.
+
Thu Mar 2 15:58:24 1995 Ian Lance Taylor <ian@cygnus.com>
+ * aoutx.h (NAME(aout,swap_ext_reloc_in)): Treat the index of a
+ base relative reloc as an index into the symbol table, regardless
+ of the setting of r_extern.
+ (NAME(aout,swap_std_reloc_in)): Likewise.
+
* aoutx.h (NAME(aout,set_section_contents)): Double check that the
caller is writing to a valid section.
obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_flags;
}
- bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 0);
+ bfd_default_set_arch_mach (abfd, bfd_arch_hppa, pa10);
bfd_get_symcount (abfd) = file_hdrp->symbol_total;
/* Initialize the saved symbol table and string table to NULL.
case R_DATA_PLABEL:
case R_CODE_PLABEL:
case R_DLT_REL:
- /* Account for any addend. */
- if (bfd_reloc->addend)
+ /* Account for any addend using R_DATA_OVERRIDE. */
+ if (bfd_reloc->howto->type != R_DATA_ONE_SYMBOL
+ && bfd_reloc->addend)
p = som_reloc_addend (abfd, bfd_reloc->addend, p,
&subspace_reloc_size, reloc_queue);
section = section->next;
}
- /* FIXME. This should really be conditional based on whether or not
- PA1.1 instructions/registers have been used.
-
- Setting of the system_id has to happen very late now that copying of
+ /* Setting of the system_id has to happen very late now that copying of
BFD private data happens *after* section contents are set. */
if (abfd->flags & (EXEC_P | DYNAMIC))
obj_som_file_hdr(abfd)->system_id = obj_som_exec_data (abfd)->system_id;
+ else if (bfd_get_mach (abfd) == pa11)
+ obj_som_file_hdr(abfd)->system_id = CPU_PA_RISC1_1;
else
obj_som_file_hdr(abfd)->system_id = CPU_PA_RISC1_0;
asymbol **symbols;
boolean just_count;
{
- unsigned int op, varname;
+ unsigned int op, varname, deallocate_contents = 0;
unsigned char *end_fixups = &fixup[end];
const struct fixup_format *fp;
char *cp;
else if (som_hppa_howto_table[op].type == R_PCREL_CALL
|| som_hppa_howto_table[op].type == R_ABS_CALL)
;
+ else if (som_hppa_howto_table[op].type == R_DATA_ONE_SYMBOL)
+ {
+ unsigned addend = var ('V');
+
+ /* Try what was specified in R_DATA_OVERRIDE first
+ (if anything). Then the hard way using the
+ section contents. */
+ rptr->addend = var ('V');
+
+ if (rptr->addend == 0 && !section->contents)
+ {
+ /* Got to read the damn contents first. We don't
+ bother saving the contents (yet). Add it one
+ day if the need arises. */
+ section->contents = malloc (section->_raw_size);
+ if (section->contents == NULL)
+ return -1;
+
+ deallocate_contents = 1;
+ bfd_get_section_contents (section->owner,
+ section,
+ section->contents,
+ 0,
+ section->_raw_size);
+ }
+ else if (rptr->addend == 0)
+ rptr->addend = bfd_get_32 (section->owner,
+ (section->contents
+ + offset - var ('L')));
+
+ }
else
rptr->addend = var ('V');
rptr++;
memset (stack, 0, sizeof (stack));
}
}
+ if (deallocate_contents)
+ free (section->contents);
+
return count;
#undef var
CONST char **functionname_ptr;
unsigned int *line_ptr;
{
- fprintf (stderr, "som_find_nearest_line unimplemented\n");
- fflush (stderr);
- abort ();
return (false);
}
/* Keep track of where each SOM will finally reside; then look
at the next BFD. */
curr_som_offset += arelt_size (curr_bfd) + sizeof (struct ar_hdr);
+
+ /* A particular object in the archive may have an odd length; the
+ linker requires objects begin on an even boundary. So round
+ up the current offset as necessary. */
+ curr_som_offset = (curr_som_offset + 0x1) & ~0x1;
curr_bfd = curr_bfd->next;
som_index++;
}
lst_size = sizeof (struct lst_header);
/* Start building the LST header. */
+ /* FIXME: Do we need to examine each element to determine the
+ largest id number? */
lst.system_id = CPU_PA_RISC1_0;
lst.a_magic = LIBMAGIC;
lst.version_id = VERSION_ID;