mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 15:18:37 +08:00
2000-11-20 Kazu Hirata <kazu@hxi.com>
* bfd-in.h: Fix formatting. * bfd-in2.h: Likewise. * bfd.c: Likewise. * bout.c: Likewise.
This commit is contained in:
@ -10,6 +10,10 @@
|
|||||||
* aoutf1.h: Likewise.
|
* aoutf1.h: Likewise.
|
||||||
* aoutx.h: Likewise.
|
* aoutx.h: Likewise.
|
||||||
* archive.c: Likewise.
|
* archive.c: Likewise.
|
||||||
|
* bfd-in.h: Likewise.
|
||||||
|
* bfd-in2.h: Likewise.
|
||||||
|
* bfd.c: Likewise.
|
||||||
|
* bout.c: Likewise.
|
||||||
|
|
||||||
2000-11-17 H.J. Lu <hjl@gnu.org>
|
2000-11-17 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
|
|||||||
|
|
||||||
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
||||||
|
|
||||||
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean)(bool)), true)
|
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true)
|
||||||
|
|
||||||
extern boolean bfd_record_phdr
|
extern boolean bfd_record_phdr
|
||||||
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
|
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
|
||||||
|
@ -512,7 +512,7 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
|
|||||||
|
|
||||||
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
||||||
|
|
||||||
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean)(bool)), true)
|
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true)
|
||||||
|
|
||||||
extern boolean bfd_record_phdr
|
extern boolean bfd_record_phdr
|
||||||
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
|
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
|
||||||
@ -804,17 +804,16 @@ bfd_make_writable PARAMS ((bfd *abfd));
|
|||||||
boolean
|
boolean
|
||||||
bfd_make_readable PARAMS ((bfd *abfd));
|
bfd_make_readable PARAMS ((bfd *abfd));
|
||||||
|
|
||||||
|
|
||||||
/* Byte swapping macros for user section data. */
|
/* Byte swapping macros for user section data. */
|
||||||
|
|
||||||
#define bfd_put_8(abfd, val, ptr) \
|
#define bfd_put_8(abfd, val, ptr) \
|
||||||
((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
|
((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
|
||||||
#define bfd_put_signed_8 \
|
#define bfd_put_signed_8 \
|
||||||
bfd_put_8
|
bfd_put_8
|
||||||
#define bfd_get_8(abfd, ptr) \
|
#define bfd_get_8(abfd, ptr) \
|
||||||
(*(unsigned char *)(ptr))
|
(*(unsigned char *) (ptr))
|
||||||
#define bfd_get_signed_8(abfd, ptr) \
|
#define bfd_get_signed_8(abfd, ptr) \
|
||||||
((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
|
((*(unsigned char *) (ptr) ^ 0x80) - 0x80)
|
||||||
|
|
||||||
#define bfd_put_16(abfd, val, ptr) \
|
#define bfd_put_16(abfd, val, ptr) \
|
||||||
BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
|
BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
|
||||||
@ -857,7 +856,6 @@ bfd_make_readable PARAMS ((bfd *abfd));
|
|||||||
: (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
|
: (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
|
||||||
: (abort (), (void) 0))
|
: (abort (), (void) 0))
|
||||||
|
|
||||||
|
|
||||||
/* Byte swapping macros for file header data. */
|
/* Byte swapping macros for file header data. */
|
||||||
|
|
||||||
#define bfd_h_put_8(abfd, val, ptr) \
|
#define bfd_h_put_8(abfd, val, ptr) \
|
||||||
@ -1303,7 +1301,7 @@ bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags));
|
|||||||
|
|
||||||
void
|
void
|
||||||
bfd_map_over_sections PARAMS ((bfd *abfd,
|
bfd_map_over_sections PARAMS ((bfd *abfd,
|
||||||
void (*func)(bfd *abfd,
|
void (*func) (bfd *abfd,
|
||||||
asection *sect,
|
asection *sect,
|
||||||
PTR obj),
|
PTR obj),
|
||||||
PTR obj));
|
PTR obj));
|
||||||
@ -1608,7 +1606,6 @@ typedef enum bfd_reloc_status
|
|||||||
}
|
}
|
||||||
bfd_reloc_status_type;
|
bfd_reloc_status_type;
|
||||||
|
|
||||||
|
|
||||||
typedef struct reloc_cache_entry
|
typedef struct reloc_cache_entry
|
||||||
{
|
{
|
||||||
/* A pointer into the canonical table of pointers */
|
/* A pointer into the canonical table of pointers */
|
||||||
@ -1792,7 +1789,6 @@ bfd_install_relocation
|
|||||||
enum bfd_reloc_code_real {
|
enum bfd_reloc_code_real {
|
||||||
_dummy_first_bfd_reloc_code_real,
|
_dummy_first_bfd_reloc_code_real,
|
||||||
|
|
||||||
|
|
||||||
/* Basic absolute relocations of N bits. */
|
/* Basic absolute relocations of N bits. */
|
||||||
BFD_RELOC_64,
|
BFD_RELOC_64,
|
||||||
BFD_RELOC_32,
|
BFD_RELOC_32,
|
||||||
@ -2046,7 +2042,6 @@ to compensate for the borrow when the low bits are added. */
|
|||||||
BFD_RELOC_MIPS_GOT_OFST,
|
BFD_RELOC_MIPS_GOT_OFST,
|
||||||
BFD_RELOC_MIPS_GOT_DISP,
|
BFD_RELOC_MIPS_GOT_DISP,
|
||||||
|
|
||||||
|
|
||||||
/* i386/elf relocations */
|
/* i386/elf relocations */
|
||||||
BFD_RELOC_386_GOT32,
|
BFD_RELOC_386_GOT32,
|
||||||
BFD_RELOC_386_PLT32,
|
BFD_RELOC_386_PLT32,
|
||||||
@ -2357,7 +2352,6 @@ bits placed non-contigously in the instruction. */
|
|||||||
/* This is a 16 bit offset from the call table base pointer. */
|
/* This is a 16 bit offset from the call table base pointer. */
|
||||||
BFD_RELOC_V850_CALLT_16_16_OFFSET,
|
BFD_RELOC_V850_CALLT_16_16_OFFSET,
|
||||||
|
|
||||||
|
|
||||||
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
|
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
|
||||||
instruction. */
|
instruction. */
|
||||||
BFD_RELOC_MN10300_32_PCREL,
|
BFD_RELOC_MN10300_32_PCREL,
|
||||||
@ -2649,7 +2643,6 @@ bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
|
|||||||
const char *
|
const char *
|
||||||
bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code));
|
bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code));
|
||||||
|
|
||||||
|
|
||||||
typedef struct symbol_cache_entry
|
typedef struct symbol_cache_entry
|
||||||
{
|
{
|
||||||
/* A pointer to the BFD which owns the symbol. This information
|
/* A pointer to the BFD which owns the symbol. This information
|
||||||
@ -3090,7 +3083,6 @@ bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
|
|||||||
#define bfd_debug_info_accumulate(abfd, section) \
|
#define bfd_debug_info_accumulate(abfd, section) \
|
||||||
BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
|
BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
|
||||||
|
|
||||||
|
|
||||||
#define bfd_stat_arch_elt(abfd, stat) \
|
#define bfd_stat_arch_elt(abfd, stat) \
|
||||||
BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
|
BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
|
||||||
|
|
||||||
@ -3168,13 +3160,13 @@ core_file_matches_executable_p
|
|||||||
(bfd_assert (__FILE__,__LINE__), NULL))
|
(bfd_assert (__FILE__,__LINE__), NULL))
|
||||||
#endif
|
#endif
|
||||||
#define BFD_SEND_FMT(bfd, message, arglist) \
|
#define BFD_SEND_FMT(bfd, message, arglist) \
|
||||||
(((bfd)->xvec->message[(int)((bfd)->format)]) arglist)
|
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
|
||||||
|
|
||||||
#ifdef DEBUG_BFD_SEND
|
#ifdef DEBUG_BFD_SEND
|
||||||
#undef BFD_SEND_FMT
|
#undef BFD_SEND_FMT
|
||||||
#define BFD_SEND_FMT(bfd, message, arglist) \
|
#define BFD_SEND_FMT(bfd, message, arglist) \
|
||||||
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
|
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
|
||||||
(((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \
|
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
|
||||||
(bfd_assert (__FILE__,__LINE__), NULL))
|
(bfd_assert (__FILE__,__LINE__), NULL))
|
||||||
#endif
|
#endif
|
||||||
enum bfd_flavour {
|
enum bfd_flavour {
|
||||||
@ -3463,7 +3455,7 @@ const char **
|
|||||||
bfd_target_list PARAMS ((void));
|
bfd_target_list PARAMS ((void));
|
||||||
|
|
||||||
const bfd_target *
|
const bfd_target *
|
||||||
bfd_search_for_target PARAMS ((int (* search_func)(const bfd_target *, void *), void *));
|
bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *));
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
|
bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
|
||||||
|
@ -833,7 +833,7 @@ DESCRIPTION
|
|||||||
Instead, we want to ask questions like "is this NNN byte sized
|
Instead, we want to ask questions like "is this NNN byte sized
|
||||||
object I'm about to try read from file offset YYY reasonable?"
|
object I'm about to try read from file offset YYY reasonable?"
|
||||||
As as example of where we might do this, some object formats
|
As as example of where we might do this, some object formats
|
||||||
use string tables for which the first <<sizeof(long)>> bytes of the
|
use string tables for which the first <<sizeof (long)>> bytes of the
|
||||||
table contain the size of the table itself, including the size bytes.
|
table contain the size of the table itself, including the size bytes.
|
||||||
If an application tries to read what it thinks is one of these
|
If an application tries to read what it thinks is one of these
|
||||||
string tables, without some way to validate the size, and for
|
string tables, without some way to validate the size, and for
|
||||||
@ -980,7 +980,7 @@ bfd_scan_vma (string, end, base)
|
|||||||
int digit;
|
int digit;
|
||||||
|
|
||||||
/* Let the host do it if possible. */
|
/* Let the host do it if possible. */
|
||||||
if (sizeof(bfd_vma) <= sizeof(unsigned long))
|
if (sizeof (bfd_vma) <= sizeof (unsigned long))
|
||||||
return (bfd_vma) strtoul (string, (char **) end, base);
|
return (bfd_vma) strtoul (string, (char **) end, base);
|
||||||
|
|
||||||
/* A negative base makes no sense, and we only need to go as high as hex. */
|
/* A negative base makes no sense, and we only need to go as high as hex. */
|
||||||
|
20
bfd/bout.c
20
bfd/bout.c
@ -306,22 +306,22 @@ b_out_write_object_contents (abfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (q > outsyms)
|
if (q > outsyms)
|
||||||
qsort (outsyms, q - outsyms, sizeof(asymbol*), b_out_symbol_cmp);
|
qsort (outsyms, q - outsyms, sizeof (asymbol*), b_out_symbol_cmp);
|
||||||
|
|
||||||
/* Back to your regularly scheduled program. */
|
/* Back to your regularly scheduled program. */
|
||||||
|
|
||||||
if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*exec_hdr(abfd))), SEEK_SET)
|
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*exec_hdr(abfd))), SEEK_SET)
|
||||||
!= 0)
|
!= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (! aout_32_write_syms (abfd))
|
if (! aout_32_write_syms (abfd))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (bfd_seek (abfd, (file_ptr)(N_TROFF(*exec_hdr(abfd))), SEEK_SET) != 0)
|
if (bfd_seek (abfd, (file_ptr) (N_TROFF(*exec_hdr(abfd))), SEEK_SET) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd))) return false;
|
if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd))) return false;
|
||||||
if (bfd_seek (abfd, (file_ptr)(N_DROFF(*exec_hdr(abfd))), SEEK_SET)
|
if (bfd_seek (abfd, (file_ptr) (N_DROFF(*exec_hdr(abfd))), SEEK_SET)
|
||||||
!= 0)
|
!= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ calljx_callback (abfd, link_info, reloc_entry, src, dst, input_section)
|
|||||||
|
|
||||||
word += value + reloc_entry->addend;
|
word += value + reloc_entry->addend;
|
||||||
|
|
||||||
bfd_put_32(abfd, word, dst);
|
bfd_put_32 (abfd, word, dst);
|
||||||
return bfd_reloc_ok;
|
return bfd_reloc_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx,
|
|||||||
- output_addr (input_section))
|
- output_addr (input_section))
|
||||||
& BAL_MASK);
|
& BAL_MASK);
|
||||||
}
|
}
|
||||||
bfd_put_32(abfd, word, (bfd_byte *) data + dstidx);
|
bfd_put_32 (abfd, word, (bfd_byte *) data + dstidx);
|
||||||
return bfd_reloc_ok;
|
return bfd_reloc_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -549,7 +549,7 @@ b_out_slurp_reloc_table (abfd, asect, symbols)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
doit:
|
doit:
|
||||||
if (bfd_seek (abfd, (file_ptr)(asect->rel_filepos), SEEK_SET) != 0)
|
if (bfd_seek (abfd, (file_ptr) (asect->rel_filepos), SEEK_SET) != 0)
|
||||||
return false;
|
return false;
|
||||||
count = reloc_size / sizeof (struct relocation_info);
|
count = reloc_size / sizeof (struct relocation_info);
|
||||||
|
|
||||||
@ -944,7 +944,7 @@ b_out_set_section_contents (abfd, section, location, offset, count)
|
|||||||
if (! aout_32_make_sections (abfd))
|
if (! aout_32_make_sections (abfd))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
obj_textsec (abfd)->filepos = sizeof(struct internal_exec);
|
obj_textsec (abfd)->filepos = sizeof (struct internal_exec);
|
||||||
obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos
|
obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos
|
||||||
+ obj_textsec (abfd)->_raw_size;
|
+ obj_textsec (abfd)->_raw_size;
|
||||||
|
|
||||||
@ -993,7 +993,7 @@ b_out_sizeof_headers (ignore_abfd, ignore)
|
|||||||
bfd *ignore_abfd ATTRIBUTE_UNUSED;
|
bfd *ignore_abfd ATTRIBUTE_UNUSED;
|
||||||
boolean ignore ATTRIBUTE_UNUSED;
|
boolean ignore ATTRIBUTE_UNUSED;
|
||||||
{
|
{
|
||||||
return sizeof(struct internal_exec);
|
return sizeof (struct internal_exec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
@ -1410,7 +1410,7 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
abort();
|
abort ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user