mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 02:24:17 +08:00
* 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:
@ -316,14 +316,8 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
|
|||||||
unsigned long *file_cursor)
|
unsigned long *file_cursor)
|
||||||
{
|
{
|
||||||
unsigned int nrelocs;
|
unsigned int nrelocs;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (idx = SEG_E0; idx < SEG_E9; idx++)
|
for (idx = SEG_E0; idx < SEG_E9; idx++)
|
||||||
{
|
{
|
||||||
if (segment_info[idx].scnhdr.s_name[0])
|
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 */
|
/* Only output some of the relocations */
|
||||||
if (TC_COUNT_RELOC(fix_ptr))
|
if (TC_COUNT_RELOC(fix_ptr))
|
||||||
{
|
{
|
||||||
|
#ifdef TC_RELOC_MANGLE(fix_ptr, &intr)
|
||||||
|
TC_RELOC_MANGLE(fix_ptr, &intr);
|
||||||
|
|
||||||
|
#else
|
||||||
symbolS *dot;
|
symbolS *dot;
|
||||||
symbol_ptr = fix_ptr->fx_addsy;
|
symbol_ptr = fix_ptr->fx_addsy;
|
||||||
|
|
||||||
intr.r_type = TC_COFF_FIX2RTYPE(fix_ptr);
|
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
|
/* Turn the segment of the symbol into an offset
|
||||||
*/
|
*/
|
||||||
dot =
|
if (symbol_ptr)
|
||||||
segment_info[S_GET_SEGMENT(symbol_ptr)].dot;
|
{
|
||||||
|
dot = segment_info[S_GET_SEGMENT(symbol_ptr)].dot;
|
||||||
if (dot)
|
if (dot)
|
||||||
{
|
{
|
||||||
intr.r_symndx = dot->sy_number;
|
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;
|
intr.r_symndx = symbol_ptr->sy_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
intr.r_symndx = -1;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
(void)bfd_coff_swap_reloc_out(abfd, &intr, ext_ptr);
|
(void)bfd_coff_swap_reloc_out(abfd, &intr, ext_ptr);
|
||||||
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 */
|
/* Turn the gas native symbol table shape into a coff symbol table */
|
||||||
crawl_symbols(&filehdr, abfd);
|
crawl_symbols(&filehdr, abfd);
|
||||||
|
#ifndef TC_H8300
|
||||||
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
|
for (i = SEG_E0; i < SEG_UNKNOWN; i++)
|
||||||
{
|
{
|
||||||
fixup_segment(segment_info[i].fix_root, i);
|
fixup_segment(segment_info[i].fix_root, i);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
file_cursor = FILHSZ + SCNHSZ * filehdr.f_nscns ;
|
file_cursor = FILHSZ + SCNHSZ * filehdr.f_nscns ;
|
||||||
|
|
||||||
|
@ -111,9 +111,10 @@ typedef struct
|
|||||||
unsigned int ost_flags; /* obj_coff internal use only flags */
|
unsigned int ost_flags; /* obj_coff internal use only flags */
|
||||||
} obj_symbol_type;
|
} obj_symbol_type;
|
||||||
|
|
||||||
|
#ifndef DO_NOT_STRIP
|
||||||
#define DO_NOT_STRIP 0
|
#define DO_NOT_STRIP 0
|
||||||
#define DO_STRIP 1
|
#define DO_STRIP 1
|
||||||
|
#endif
|
||||||
/* Symbol table macros and constants */
|
/* Symbol table macros and constants */
|
||||||
|
|
||||||
/* Possible and usefull section number in symbol table
|
/* Possible and usefull section number in symbol table
|
||||||
|
Reference in New Issue
Block a user