oasys_reloc_type *r =
(oasys_reloc_type *)
bfd_alloc(abfd,
- sizeof(oasys_reloc_type));
+ sizeof(oasys_reloc_type));
*(per->reloc_tail_ptr) = r;
per->reloc_tail_ptr = &r->next;
r->next= (oasys_reloc_type *)NULL;
r->relent.howto = &howto_table[reloc>>6];
r->relent.sym_ptr_ptr = (asymbol **)NULL;
section->reloc_count++;
+
+ /* Fake up the data to look like it's got the -ve pc in it, this makes
+ it much easier to convert into other formats. This is done by
+ hitting the addend.
+ */
+ if (r->relent.howto->pc_relative == true) {
+ r->relent.addend -= dst_ptr - dst_base_ptr;
+ }
+
+
}
break;
oasys_reloc_type *r =
(oasys_reloc_type *)
bfd_alloc(abfd,
- sizeof(oasys_reloc_type));
+ sizeof(oasys_reloc_type));
*(per->reloc_tail_ptr) = r;
per->reloc_tail_ptr = &r->next;
r->next= (oasys_reloc_type *)NULL;
section->reloc_count++;
src+=2;
+ /* Fake up the data to look like it's got the -ve pc in it, this makes
+ it much easier to convert into other formats. This is done by
+ hitting the addend.
+ */
+ if (r->relent.howto->pc_relative == true) {
+ r->relent.addend -= dst_ptr - dst_base_ptr;
+ }
+
+
+
}
break;
case RELOCATION_TYPE_COM:
*mod |= (1<<i);
if(how->pc_relative) {
rel_byte = 0x80;
+
+ /* Also patch the raw data so that it doesn't have
+ the -ve stuff any more */
+ if (how->size != 2) {
+ bfd_putshort(abfd,
+ bfd_getshort(abfd,raw_data) +
+ current_byte_index, raw_data);
+ }
+
+ else {
+ bfd_putlong(abfd,
+ bfd_getlong(abfd,raw_data) +
+ current_byte_index, raw_data);
+ }
}
else {
rel_byte = 0;
if (how->size ==2) {
rel_byte |= 0x40;
}
-
+
/* Is this a section relative relocation, or a symbol
relative relocation ? */
if (r->section != (asection*)NULL)
}
static int
-oasys_generic_stat_arch_elt(abfd, buf)
-bfd *abfd;
-struct stat *buf;
+DEFUN(oasys_generic_stat_arch_elt,(abfd, buf),
+ bfd *abfd AND
+ struct stat *buf)
{
oasys_module_info_type *mod = (oasys_module_info_type *) abfd->arelt_data;
if (mod == (oasys_module_info_type *)NULL) {
else {
buf->st_size = mod->size;
buf->st_mode = 0666;
- return 0;
+ return 0;
}
}