diff options
author | Tim Wall <twall@redhat.com> | 2000-04-18 06:21:27 +0400 |
---|---|---|
committer | Tim Wall <twall@redhat.com> | 2000-04-18 06:21:27 +0400 |
commit | e11ddfb02d7fcd85e263a0d1e96bcd5b0d4d788d (patch) | |
tree | a617fd9d58c823c3f8187b3b1a054877af6a520c | |
parent | 2cf2f0980f6606aa55b41997b8e3e393ca496cf3 (diff) |
Clean up load page support for tic54x.
-rw-r--r-- | include/coff/ChangeLog | 5 | ||||
-rw-r--r-- | include/coff/internal.h | 1 | ||||
-rw-r--r-- | include/coff/ti.h | 29 |
3 files changed, 17 insertions, 18 deletions
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog index 401fbee28..dd6ca19af 100644 --- a/include/coff/ChangeLog +++ b/include/coff/ChangeLog @@ -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+. diff --git a/include/coff/internal.h b/include/coff/internal.h index a9f64c003..c6f276036 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -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 */ }; /* diff --git a/include/coff/ti.h b/include/coff/ti.h index 306ad7b2c..fb3456d87 100644 --- a/include/coff/ti.h +++ b/include/coff/ti.h @@ -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 |