- asymbol *sym = *(*rptr)->sym_ptr_ptr;
- asection *sec = sym->section;
-
- switch ((*rptr)->howto->type)
- {
- case ALPHA_R_IGNORE:
- break;
-
- case ALPHA_R_REFLONG:
- {
- if (bfd_is_und_section (sym->section))
- {
- int slen = strlen ((char *) sym->name);
- char *hash;
-
- if (_bfd_vms_output_check (abfd, slen) < 0)
- {
- end_etir_record (abfd);
- start_etir_record (abfd,
- section->index,
- vaddr, FALSE);
- }
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STO_GBL_LW,
- -1);
- hash = (_bfd_vms_length_hash_symbol
- (abfd, sym->name, EOBJ_S_C_SYMSIZ));
- _bfd_vms_output_counted (abfd, hash);
- _bfd_vms_output_flush (abfd);
- }
- else if (bfd_is_abs_section (sym->section))
- {
- if (_bfd_vms_output_check (abfd, 16) < 0)
- {
- end_etir_record (abfd);
- start_etir_record (abfd,
- section->index,
- vaddr, FALSE);
- }
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STA_LW,
- -1);
- _bfd_vms_output_quad (abfd,
- (uquad) sym->value);
- _bfd_vms_output_flush (abfd);
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STO_LW,
- -1);
- _bfd_vms_output_flush (abfd);
- }
- else
- {
- if (_bfd_vms_output_check (abfd, 32) < 0)
- {
- end_etir_record (abfd);
- start_etir_record (abfd,
- section->index,
- vaddr, FALSE);
- }
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STA_PQ,
- -1);
- _bfd_vms_output_long (abfd,
- (unsigned long) (sec->index));
- _bfd_vms_output_quad (abfd,
- ((uquad) (*rptr)->addend
- + (uquad) sym->value));
- _bfd_vms_output_flush (abfd);
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STO_LW,
- -1);
- _bfd_vms_output_flush (abfd);
- }
- }
- break;
-
- case ALPHA_R_REFQUAD:
- {
- if (bfd_is_und_section (sym->section))
- {
- int slen = strlen ((char *) sym->name);
- char *hash;
- if (_bfd_vms_output_check (abfd, slen) < 0)
- {
- end_etir_record (abfd);
- start_etir_record (abfd,
- section->index,
- vaddr, FALSE);
- }
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STO_GBL,
- -1);
- hash = (_bfd_vms_length_hash_symbol
- (abfd, sym->name, EOBJ_S_C_SYMSIZ));
- _bfd_vms_output_counted (abfd, hash);
- _bfd_vms_output_flush (abfd);
- }
- else if (bfd_is_abs_section (sym->section))
- {
- if (_bfd_vms_output_check (abfd, 16) < 0)
- {
- end_etir_record (abfd);
- start_etir_record (abfd,
- section->index,
- vaddr, FALSE);
- }
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STA_QW,
- -1);
- _bfd_vms_output_quad (abfd,
- (uquad) sym->value);
- _bfd_vms_output_flush (abfd);
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STO_QW,
- -1);
- _bfd_vms_output_flush (abfd);
- }
- else
- {
- if (_bfd_vms_output_check (abfd, 32) < 0)
- {
- end_etir_record (abfd);
- start_etir_record (abfd,
- section->index,
- vaddr, FALSE);
- }
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STA_PQ,
- -1);
- _bfd_vms_output_long (abfd,
- (unsigned long) (sec->index));
- _bfd_vms_output_quad (abfd,
- ((uquad) (*rptr)->addend
- + (uquad) sym->value));
- _bfd_vms_output_flush (abfd);
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STO_OFF,
- -1);
- _bfd_vms_output_flush (abfd);
- }
- }
- break;
-
- case ALPHA_R_HINT:
- {
- int hint_size;
- char *hash ATTRIBUTE_UNUSED;
-
- hint_size = sptr->size;
- sptr->size = len;
- sto_imm (abfd, sptr, vaddr, section->index);
- sptr->size = hint_size;
-#if 0
- vms_output_begin (abfd,
- ETIR_S_C_STO_HINT_GBL, -1);
- vms_output_long (abfd,
- (unsigned long) (sec->index));
- vms_output_quad (abfd, (uquad) addr);
-
- hash = (_bfd_vms_length_hash_symbol
- (abfd, sym->name, EOBJ_S_C_SYMSIZ));
- vms_output_counted (abfd, hash);
-
- vms_output_flush (abfd);
-#endif
- }
- break;
- case ALPHA_R_LINKAGE:
- {
- char *hash;
-
- if (_bfd_vms_output_check (abfd, 64) < 0)
- {
- end_etir_record (abfd);
- start_etir_record (abfd, section->index,
- vaddr, FALSE);
- }
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STC_LP_PSB,
- -1);
- _bfd_vms_output_long (abfd,
- (unsigned long) PRIV (vms_linkage_index));
- PRIV (vms_linkage_index) += 2;
- hash = (_bfd_vms_length_hash_symbol
- (abfd, sym->name, EOBJ_S_C_SYMSIZ));
- _bfd_vms_output_counted (abfd, hash);
- _bfd_vms_output_byte (abfd, 0);
- _bfd_vms_output_flush (abfd);
- }
- break;
-
- case ALPHA_R_CODEADDR:
- {
- int slen = strlen ((char *) sym->name);
- char *hash;
- if (_bfd_vms_output_check (abfd, slen) < 0)
- {
- end_etir_record (abfd);
- start_etir_record (abfd,
- section->index,
- vaddr, FALSE);
- }
- _bfd_vms_output_begin (abfd,
- ETIR_S_C_STO_CA,
- -1);
- hash = (_bfd_vms_length_hash_symbol
- (abfd, sym->name, EOBJ_S_C_SYMSIZ));
- _bfd_vms_output_counted (abfd, hash);
- _bfd_vms_output_flush (abfd);
- }
- break;
-
- default:
- (*_bfd_error_handler) (_("Unhandled relocation %s"),
- (*rptr)->howto->name);
- break;
- }
-
- vaddr += len;
-
- if (len == sptr->size)
- {
- break;
- }
- else
- {
- sptr->contents += len;
- sptr->offset += len;
- sptr->size -= len;
- i--;
- rptr++;
- }