+Tue Sep 13 17:57:00 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_object_setup): Handle exec_entry and exec_flags being
+ switched in executables created by the OSF1 linker.
+ (som_write_fixups): Handle R_EXIT just like the R_{F,L,R}SEL
+ fixups. Support R_ALT_ENTRY (handle just like R_EXIT).
+
Tue Sep 13 16:04:07 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* cofflink.c (coff_link_input_bfd): syment_base is unsigned
break;
}
- bfd_get_start_address (abfd) = aux_hdrp->exec_entry;
+ /* Allocate space to hold the saved exec header information. */
+ obj_som_exec_data (abfd) = (struct som_exec_data *)
+ bfd_zalloc (abfd, sizeof (struct som_exec_data ));
+ if (obj_som_exec_data (abfd) == NULL)
+ {
+ bfd_set_error (bfd_error_no_memory);
+ return NULL;
+ }
+
+ /* The braindamaged OSF1 linker switched exec_flags and exec_entry!
+
+ It seems rather backward that the OSF1 linker which is much
+ older than any HPUX linker I've got uses a newer SOM version
+ id... But that's what I've found by experimentation. */
+ if (file_hdrp->version_id == NEW_VERSION_ID)
+ {
+ bfd_get_start_address (abfd) = aux_hdrp->exec_flags;
+ obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_entry;
+ }
+ else
+ {
+ bfd_get_start_address (abfd) = aux_hdrp->exec_entry;
+ obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_flags;
+ }
+
bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 0);
bfd_get_symcount (abfd) = file_hdrp->symbol_total;
obj_som_sym_filepos (abfd) = file_hdrp->symbol_location;
obj_som_str_filepos (abfd) = file_hdrp->symbol_strings_location;
obj_som_reloc_filepos (abfd) = file_hdrp->fixup_request_location;
-
- obj_som_exec_data (abfd) = (struct som_exec_data *)
- bfd_zalloc (abfd, sizeof (struct som_exec_data ));
- if (obj_som_exec_data (abfd) == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
-
obj_som_exec_data (abfd)->system_id = file_hdrp->system_id;
- obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_flags;
+
return abfd->xvec;
}
/* This only needs to handle relocations that may be
made by hppa_som_gen_reloc. */
case R_ENTRY:
+ case R_ALT_ENTRY:
case R_EXIT:
case R_N_MODE:
case R_S_MODE:
break;
}
- case R_EXIT:
- bfd_put_8 (abfd, R_EXIT, p);
- subspace_reloc_size += 1;
- p += 1;
- break;
-
case R_N_MODE:
case R_S_MODE:
case R_D_MODE:
}
break;
+ case R_EXIT:
+ case R_ALT_ENTRY:
case R_FSEL:
case R_LSEL:
case R_RSEL: