+Thu Aug 8 12:21:56 1996 Klaus Kaempf <kkaempf@progis.de>
+
+ * evax-alpha.c (evax_alpha_vec): Corrected flags, cleanup.
+ (evax_initialize): Remove evax_reloc_table.
+ (evax_close_and_cleanup): Ditto.
+ (reloc_nil): Ditto.
+ (alpha_howto_table): Remove ALPHA_R_SWREL32 and ALPHA_R_SWREL64
+ entries.
+ (evax_bfd_reloc_type_lookup): Ditto.
+ * evax-egsd.c (_bfd_evax_slurp_egsd): Add a few casts; set
+ cooked_size == raw_size.
+ * evax-emh.c (_bfd_evax_register_filename): Remove.
+ * evax-etir.c (etir_stc): Allow ETIR_S_C_STC_xx commands.
+ * evax-misc.c (add_new_contents): Malloc section at full size.
+ (_bfd_save_evax_section): Memcpy section contents directly.
+ * evax.h (ALPHA_R_SWREL32, ALPHA_R_SWREL64): Remove.
+ (evax_reloc_table): Remove.
+
+ * hosts/alphavms.h (O_ACCMODE): Define if needed.
+
+ * makefile.vms: Add better support for DEC C compilation
+ Add evax.h dependencies
+
+ * reloc.c (bfd_get_reloc_size): Add case for 16 byte reloc.
+ (BFD_RELOC_SWREL32,BFD_RELOC_SWREL64): Remove.
+ (BFD_RELOC_ALPHA_BASEREG): Remove.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
Thu Aug 8 08:17:32 1996 Stu Grossman (grossman@critters.cygnus.com)
* archive.c (bsd_write_armap): Ifdef around calls to getuid and
false, /* data byte order is little */
false, /* header byte order is little */
- (HAS_RELOC | /* object flags */
- HAS_LINENO | HAS_DEBUG |
- HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-
- (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */
+ (HAS_RELOC | HAS_SYMS
+ | WP_TEXT | D_PAGED), /* object flags */
+ (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+ | SEC_READONLY | SEC_CODE | SEC_DATA
+ | SEC_HAS_CONTENTS | SEC_IN_MEMORY), /* sect flags */
0, /* symbol_leading_char */
' ', /* ar_pad_char */
15, /* ar_max_namelen */
- bfd_getl64, /* bfd_getx64 */
- bfd_getl_signed_64, /* bfd_getx_signed_64 */
- bfd_putl64, /* bfd_putx64 */
- bfd_getl32, /* bfd_getx32 */
- bfd_getl_signed_32, /* bfd_getx_signed_32 */
- bfd_putl32, /* bfd_putx32 */
- bfd_getl16, /* bfd_getx16 */
- bfd_getl_signed_16, /* bfd_getx_signed_16 */
- bfd_putl16, /* bfd_putx16 */
- bfd_getl64, /* bfd_h_getx64 */
- bfd_getl_signed_64, /* bfd_h_getx_signed_64 */
- bfd_putl64, /* bfd_h_putx64 */
- bfd_getl32, /* bfd_h_getx32 */
- bfd_getl_signed_32, /* bfd_h_getx_signed_32 */
- bfd_putl32, /* bfd_h_putx32 */
- bfd_getl16, /* bfd_h_getx16 */
- bfd_getl_signed_16, /* bfd_h_getx_signed_16 */
- bfd_putl16, /* bfd_h_putx16 */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16,
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16,
{_bfd_dummy_target, evax_object_p, /* bfd_check_format */
evax_archive_p, _bfd_dummy_target},
goto evax_init_no_mem2;
}
- for (i=0; i<EVAX_SECTION_COUNT; i++)
- {
- PRIV(evax_section_table)[i] = NULL;
- PRIV(evax_reloc_table)[i] = NULL;
- }
+ for (i = 0; i < EVAX_SECTION_COUNT; i++)
+ PRIV(evax_section_table)[i] = NULL;
PRIV(output_buf) = (unsigned char *) malloc (MAX_OUTREC_SIZE);
if (PRIV(output_buf) == 0)
es = es1;
}
PRIV(evax_section_table)[i] = NULL;
-
- er = PRIV(evax_reloc_table)[i];
- while (er != NULL)
- {
- er1 = er->next;
- free (er);
- er = er1;
- }
- PRIV(evax_reloc_table)[i] = NULL;
}
free (abfd->tdata.any);
bfd *output_bfd;
char **error_message;
{
- evax_reloc *er;
-
#if EVAX_DEBUG
evax_debug (1, "reloc_nil(abfd %p, output_bfd %p)\n", abfd, output_bfd);
evax_debug (2, "In section %s, symbol %s\n",
/* _bfd_hexdump (2, data, bfd_get_reloc_size(reloc->howto),0); */
#endif
- er = (evax_reloc *)malloc (sizeof(evax_reloc));
- if (er == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return bfd_reloc_notsupported; /* FIXME */
- }
- er->section = sec;
- er->reloc = reloc;
- er->next = NULL;
- if (PRIV(evax_reloc_table)[sec->index] == NULL)
- {
- PRIV(evax_reloc_table)[sec->index] = er;
- }
- else
- {
- er->next = PRIV(evax_reloc_table)[sec->index];
- }
return bfd_reloc_ok;
}
0, /* dst_mask */
false), /* pcrel_offset */
- /* Switch table, 32bit relocation. */
- HOWTO (ALPHA_R_SWREL32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- reloc_nil, /* special_function */
- "SWREL32", /* name */
- false, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- false), /* pcrel_offset */
-
- /* Switch table, 64bit relocation. */
- HOWTO (ALPHA_R_SWREL64, /* type */
- 0, /* rightshift */
- 4, /* size (0 = byte, 1 = short, 2 = long) */
- 64, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- reloc_nil, /* special_function */
- "SWREL64", /* name */
- false, /* partial_inplace */
- MINUS_ONE, /* src_mask */
- MINUS_ONE, /* dst_mask */
- false), /* pcrel_offset */
-
/* A 32 bit reference to a symbol. */
HOWTO (ALPHA_R_REFLONG, /* type */
0, /* rightshift */
case BFD_RELOC_32_PCREL: alpha_type = ALPHA_R_SREL32; break;
case BFD_RELOC_64_PCREL: alpha_type = ALPHA_R_SREL64; break;
case BFD_RELOC_ALPHA_LINKAGE: alpha_type = ALPHA_R_LINKAGE; break;
- case BFD_RELOC_SWREL32: alpha_type = ALPHA_R_SWREL32; break;
- case BFD_RELOC_SWREL64: alpha_type = ALPHA_R_SWREL64; break;
#if 0
case ???: alpha_type = ALPHA_R_OP_PUSH; break;
case ???: alpha_type = ALPHA_R_OP_STORE; break;
#if EVAX_DEBUG
evax_debug (1, "evax_set_section_contents(%p, sec %s, loc %p, off %ld, count %d)\n",
abfd, section->name, location, (long int)offset, (int)count);
+ evax_debug (2, "secraw %d, seccooked %d\n", (int)section->_raw_size, (int)section->_cooked_size);
#endif
return _bfd_save_evax_section(abfd, section, location, offset, count);
}
return -1;
old_flags = bfd_getl16 (evax_rec + 6);
section->_raw_size = bfd_getl32 (evax_rec + 8); /* allocation */
- new_flags = evax_secflag_by_name (name, section->_raw_size);
+ new_flags = evax_secflag_by_name (name, (int) section->_raw_size);
if (old_flags & EGPS_S_V_REL)
new_flags |= SEC_RELOC;
if (!bfd_set_section_flags (abfd, section, new_flags))
if ((base_addr % align_addr) != 0)
base_addr += (align_addr - (base_addr % align_addr));
section->vma = (bfd_vma)base_addr;
- base_addr += section->_raw_size; /* FIXME: should be cooked size */
- section->contents = (unsigned char *) malloc (section->_raw_size);
+ base_addr += section->_raw_size;
+ section->contents = ((unsigned char *)
+ bfd_malloc (section->_raw_size));
if (section->contents == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return -1;
- }
- memset (section->contents, 0, section->_raw_size);
+ return -1;
+ memset (section->contents, 0, (size_t) section->_raw_size);
+ section->_cooked_size = section->_raw_size;
#if EVAX_DEBUG
evax_debug(3, "egsd psc %d (%s, flags %04x=%s) ",
section->index, name, old_flags, flag2str(gpsflagdesc, old_flags));
{
evax_section *sptr, *newptr;
- newptr = (evax_section *) bfd_zalloc (abfd, sizeof (evax_section));
- if (newptr == (evax_section *)NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
sptr = PRIV(evax_section_table)[section->index];
- if (sptr == NULL)
- {
- PRIV(evax_section_table)[section->index] = (evax_section *)newptr;
- }
- else
- {
- while (sptr->next != NULL)
- sptr = sptr->next;
- sptr->next = newptr;
- }
+ if (sptr != NULL)
+ return sptr;
+
+ newptr = (evax_section *) bfd_malloc (sizeof (evax_section));
+ if (newptr == (evax_section *) NULL)
+ return NULL;
+ newptr->contents = (unsigned char *) bfd_alloc (abfd, section->_raw_size);
+ if (newptr->contents == (unsigned char *)NULL)
+ return NULL;
+ newptr->offset = 0;
+ newptr->size = section->_raw_size;
+ newptr->next = 0;
+ PRIV(evax_section_table)[section->index] = newptr;
return newptr;
}
sptr = add_new_contents (abfd, section);
if (sptr == NULL)
return false;
- sptr->contents = (unsigned char *) bfd_alloc (abfd, (int)count);
- if (sptr->contents == (unsigned char *)NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
- memcpy (sptr->contents, data, (int)count);
- sptr->offset = (bfd_vma)offset;
- sptr->size = count;
-
-#if EVAX_DEBUG
- evax_debug (6, "_bfd_save_evax_section sptr = %08lx\n", sptr);
- _bfd_hexdump (6, data, count, (int)offset);
-#endif
+ memcpy (sptr->contents + offset, data, (size_t) count);
return true;
}