if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \
|| bfd_bwrite (&exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
abfd) != EXEC_BYTES_SIZE) \
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \
|| bfd_bwrite (&exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
abfd) != EXEC_BYTES_SIZE) \
/* Now write out reloc info, followed by syms and strings */ \
\
if (bfd_get_symcount (abfd) != 0) \
{ \
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) \
!= 0) \
/* Now write out reloc info, followed by syms and strings */ \
\
if (bfd_get_symcount (abfd) != 0) \
{ \
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) \
!= 0) \
if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) \
!= 0) \
return 0; \
\
if (!NAME(lynx,squirt_out_relocs) (abfd, obj_datasec (abfd))) \
if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) \
!= 0) \
return 0; \
\
if (!NAME(lynx,squirt_out_relocs) (abfd, obj_datasec (abfd))) \
const bfd_target *lynx_core_file_p ();
#define MY_core_file_failing_command lynx_core_file_failing_command
const bfd_target *lynx_core_file_p ();
#define MY_core_file_failing_command lynx_core_file_failing_command
- /* undefined symbol */ \
- cache_ptr->sym_ptr_ptr = symbols + r_index; \
- cache_ptr->addend = ad; \
+ /* undefined symbol */ \
+ if (r_index < bfd_get_symcount (abfd)) \
+ cache_ptr->sym_ptr_ptr = symbols + r_index; \
+ cache_ptr->addend = ad; \
- /* defined, section relative. replace symbol with pointer to \
- symbol which points to section */ \
- switch (r_index) { \
- case N_TEXT: \
- case N_TEXT | N_EXT: \
- cache_ptr->sym_ptr_ptr = obj_textsec(abfd)->symbol_ptr_ptr; \
- cache_ptr->addend = ad - su->textsec->vma; \
- break; \
- case N_DATA: \
- case N_DATA | N_EXT: \
- cache_ptr->sym_ptr_ptr = obj_datasec(abfd)->symbol_ptr_ptr; \
- cache_ptr->addend = ad - su->datasec->vma; \
- break; \
- case N_BSS: \
- case N_BSS | N_EXT: \
- cache_ptr->sym_ptr_ptr = obj_bsssec(abfd)->symbol_ptr_ptr; \
- cache_ptr->addend = ad - su->bsssec->vma; \
- break; \
- default: \
- case N_ABS: \
- case N_ABS | N_EXT: \
- cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; \
- cache_ptr->addend = ad; \
- break; \
+ /* defined, section relative. replace symbol with pointer to \
+ symbol which points to section */ \
+ switch (r_index) \
+ { \
+ case N_TEXT: \
+ case N_TEXT | N_EXT: \
+ cache_ptr->sym_ptr_ptr = obj_textsec(abfd)->symbol_ptr_ptr; \
+ cache_ptr->addend = ad - su->textsec->vma; \
+ break; \
+ case N_DATA: \
+ case N_DATA | N_EXT: \
+ cache_ptr->sym_ptr_ptr = obj_datasec(abfd)->symbol_ptr_ptr; \
+ cache_ptr->addend = ad - su->datasec->vma; \
+ break; \
+ case N_BSS: \
+ case N_BSS | N_EXT: \
+ cache_ptr->sym_ptr_ptr = obj_bsssec(abfd)->symbol_ptr_ptr; \
+ cache_ptr->addend = ad - su->bsssec->vma; \
+ break; \
+ default: \
+ case N_ABS: \
+ case N_ABS | N_EXT: \
+ cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; \
+ cache_ptr->addend = ad; \
+ break; \
+ } \
relocs = _bfd_alloc_and_read (abfd, reloc_size, reloc_size);
if (!relocs && reloc_size != 0)
{
free (reloc_cache);
relocs = _bfd_alloc_and_read (abfd, reloc_size, reloc_size);
if (!relocs && reloc_size != 0)
{
free (reloc_cache);
bfd_release (abfd, relocs);
asect->relocation = reloc_cache;
asect->reloc_count = count;
bfd_release (abfd, relocs);
asect->relocation = reloc_cache;
asect->reloc_count = count;
each_size = obj_reloc_entry_size (abfd);
natsize = count;
natsize *= each_size;
native = (unsigned char *) bfd_zalloc (abfd, natsize);
if (!native)
each_size = obj_reloc_entry_size (abfd);
natsize = count;
natsize *= each_size;
native = (unsigned char *) bfd_zalloc (abfd, natsize);
if (!native)
if (bfd_bwrite (native, natsize, abfd) != natsize)
{
bfd_release (abfd, native);
if (bfd_bwrite (native, natsize, abfd) != natsize)
{
bfd_release (abfd, native);