Clean up load page support for tic54x.

This commit is contained in:
Tim Wall 2000-04-18 02:21:27 +00:00
parent 2cf2f0980f
commit e11ddfb02d
3 changed files with 17 additions and 18 deletions

View File

@ -1,3 +1,8 @@
2000-04-17 Timothy Wall <twall@cygnus.com>
* ti.h: Load page cleanup.
* intental.h: Add load page field.
Mon Apr 17 16:44:01 2000 David Mosberger <davidm@hpl.hp.com>
* pe.h (PEP64AOUTHDR): New header for PE+.

View File

@ -303,6 +303,7 @@ struct internal_scnhdr
unsigned long s_nlnno; /* number of line number entries*/
long s_flags; /* flags */
long s_align; /* used on I960 */
unsigned char s_page; /* TI COFF load page */
};
/*

View File

@ -71,12 +71,10 @@ struct external_filehdr {
#define COFF2_BADMAG(x) ((x).f_magic != TICOFF2MAGIC || (x).f_target_id != TI_TARGET_ID)
/* we need to read/write an extra field in the coff file header */
/* FIXME load page */
#ifndef COFF_ADJUST_FILEHDR_IN_POST
#define COFF_ADJUST_FILEHDR_IN_POST(abfd,src,dst) \
do { ((struct internal_filehdr *)(dst))->f_target_id = \
bfd_h_get_16(abfd, (bfd_byte *)(((FILHDR *)(src))->f_target_id)); \
/*((struct internal_filehdr *)(dst))->f_flags |= F_LDPAGE;*/ \
} while(0)
#endif
@ -161,9 +159,6 @@ struct external_scnhdr {
/*
* Special section flags
*/
/* recognized load pages */
#define PG_PROG 0x0 /* PROG page */
#define PG_DATA 0x1 /* DATA page */
/* TI COFF defines these flags;
STYP_CLINK: the section should be excluded from the final
@ -212,18 +207,15 @@ bfd_h_put_8 (ABFD,VAL,(PTR)-7), bfd_h_put_8 (ABFD, 0, (PTR)-8))
#define PUT_SCNHDR_SIZE(ABFD,SZ,SZP) \
bfd_h_put_32(ABFD,(SZ)/bfd_octets_per_byte(ABFD),SZP)
/* FIXME load page
#define COFF_ADJUST_SCNHDR_IN_POST(ABFD,EXT,INT) \
do { ((struct internal_scnhdr *)(INT))->s_page = \
GET_SCNHDR_PAGE(ABFD,(bfd_byte *)((SCNHDR *)(EXT))->s_page); \
} while(0)
*/
/* The line number and reloc overflow checking in coff_swap_scnhdr_out in
coffswap.h doesn't use PUT_X for s_nlnno and s_nreloc.
Due to different sized v0/v1/v2 section headers, we have to re-write these
fields.
FIXME load page
*/
#define COFF_ADJUST_SCNHDR_OUT_POST(ABFD,INT,EXT) \
do { \
@ -233,13 +225,13 @@ PUT_SCNHDR_NRELOC(ABFD,((struct internal_scnhdr *)(INT))->s_nreloc,\
(bfd_byte *)((SCNHDR *)(EXT))->s_nreloc); \
PUT_SCNHDR_FLAGS(ABFD,((struct internal_scnhdr *)(INT))->s_flags, \
(bfd_byte *)((SCNHDR *)(EXT))->s_flags); \
/*PUT_SCNHDR_PAGE(ABFD,((struct internal_scnhdr *)(INT))->s_page, \
(bfd_byte *)((SCNHDR *)(EXT))->s_page);*/ \
PUT_SCNHDR_PAGE(ABFD,((struct internal_scnhdr *)(INT))->s_page, \
(bfd_byte *)((SCNHDR *)(EXT))->s_page); \
} while(0)
/* page macros
/* Page macros
the first GDB port requires flags in its remote memory access commands to
The first GDB port requires flags in its remote memory access commands to
distinguish between data/prog space. hopefully we can make this go away
eventually. stuff the page in the upper bits of a 32-bit address, since
the c5x family only uses 16 or 23 bits.
@ -250,12 +242,13 @@ PUT_SCNHDR_FLAGS(ABFD,((struct internal_scnhdr *)(INT))->s_flags, \
addresses.
*/
#define LONG_ADDRESSES 1
#define PG_SHIFT (LONG_ADDRESSES ? 30 : 16)
#define ADDR_MASK (((unsigned long) 1 << PG_SHIFT) - 1)
#define PG_MASK ((unsigned long) 3 << PG_SHIFT)
#define PG_TO_FLAG(p) ((p) << PG_SHIFT)
#define FLAG_TO_PG(f) (((f) & PG_MASK) >> PG_SHIFT)
/* recognized load pages */
#define PG_PROG 0x0 /* PROG page */
#define PG_DATA 0x1 /* DATA page */
#define ADDR_MASK 0x00FFFFFF
#define PG_TO_FLAG(p) (((unsigned long)(p) & 0xFF) << 24)
#define FLAG_TO_PG(f) (((f) >> 24) & 0xFF)
/*
* names of "special" sections