* config/obj-coffbfd.c: lint, don't fixup relocs if H8300, use

tc_reloc_mangle to prepare relocation if one available
	* config/tc-h8300.h: added tc_reloc_mangle routine
This commit is contained in:
Steve Chamberlain
1991-12-12 02:17:22 +00:00
parent b4e2425020
commit 410e67eb21
2 changed files with 91 additions and 79 deletions

View File

@ -316,14 +316,8 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
unsigned long *file_cursor)
{
unsigned int nrelocs;
unsigned int idx;
for (idx = SEG_E0; idx < SEG_E9; idx++)
{
if (segment_info[idx].scnhdr.s_name[0])
@ -354,18 +348,26 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
/* Only output some of the relocations */
if (TC_COUNT_RELOC(fix_ptr))
{
#ifdef TC_RELOC_MANGLE(fix_ptr, &intr)
TC_RELOC_MANGLE(fix_ptr, &intr);
#else
symbolS *dot;
symbol_ptr = fix_ptr->fx_addsy;
intr.r_type = TC_COFF_FIX2RTYPE(fix_ptr);
intr.r_vaddr = base + fix_ptr->fx_frag->fr_address + fix_ptr->fx_where ;
intr.r_vaddr =
base + fix_ptr->fx_frag->fr_address + fix_ptr->fx_where ;
intr.r_offset = fix_ptr->fx_offset;
intr.r_offset = 0;
/* Turn the segment of the symbol into an offset
*/
dot =
segment_info[S_GET_SEGMENT(symbol_ptr)].dot;
if (symbol_ptr)
{
dot = segment_info[S_GET_SEGMENT(symbol_ptr)].dot;
if (dot)
{
intr.r_symndx = dot->sy_number;
@ -375,6 +377,14 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
intr.r_symndx = symbol_ptr->sy_number;
}
}
else
{
intr.r_symndx = -1;
}
#endif
(void)bfd_coff_swap_reloc_out(abfd, &intr, ext_ptr);
ext_ptr++;
@ -1622,11 +1632,12 @@ extern void DEFUN_VOID(write_object_file)
/* Turn the gas native symbol table shape into a coff symbol table */
crawl_symbols(&filehdr, abfd);
#ifndef TC_H8300
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
{
fixup_segment(segment_info[i].fix_root, i);
}
#endif
file_cursor = FILHSZ + SCNHSZ * filehdr.f_nscns ;

View File

@ -111,9 +111,10 @@ typedef struct
unsigned int ost_flags; /* obj_coff internal use only flags */
} obj_symbol_type;
#ifndef DO_NOT_STRIP
#define DO_NOT_STRIP 0
#define DO_STRIP 1
#endif
/* Symbol table macros and constants */
/* Possible and usefull section number in symbol table