Changeset 1248
- Timestamp:
- Feb 15, 2004, 10:53:13 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/binutils/bfd/i386aoutemx.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1247 r1248 24 24 #include "bfd.h" 25 25 #include "libbfd.h" 26 #include "libaout.h"27 26 #ifndef EMX 28 27 #error "EMX TARGET! EMX isn't defined!!!" 29 28 #endif 30 29 31 #define MY_object_p MY(object_p) 32 #define MY_backend_data &MY(backend_data) 33 34 static bfd_boolean MY(set_sizes) PARAMS ((bfd *)); 35 static const bfd_target *MY(object_p) PARAMS ((bfd *)); 36 37 static CONST struct aout_backend_data MY(backend_data) = { 30 #include <symcat.h> 31 #define MY_object_p MY(object_p) 32 #define MY_backend_data &MY(backend_data) 33 #define MY_bfd_reloc_type_lookup i386aout_emx_reloc_type_lookup 34 35 #include "libaout.h" 36 #include "aout/aout64.h" 37 38 static bfd_boolean MY(set_sizes) PARAMS ((bfd *)); 39 const bfd_target * MY(object_p) PARAMS ((bfd *)); 40 reloc_howto_type * MY(reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); 41 bfd_reloc_status_type MY(generic_reloc) PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); 42 /*reloc_howto_type * MY(reloc_howto) PARAMS ((bfd *, struct reloc_std_external *, int *, int *, int *));*/ 43 44 reloc_howto_type MY(howto_table_std)[] = 45 { 46 /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */ 47 HOWTO ( 0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"8", TRUE, 0x000000ff,0x000000ff, FALSE), 48 HOWTO ( 1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"16", TRUE, 0x0000ffff,0x0000ffff, FALSE), 49 HOWTO ( 2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"32", TRUE, 0xffffffff,0xffffffff, FALSE), 50 HOWTO ( 3, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"64", TRUE, 0xdeaddead,0xdeaddead, FALSE), 51 HOWTO ( 4, 0, 0, 8, TRUE, 0, complain_overflow_signed, MY(generic_reloc),"DISP8", TRUE, 0x000000ff,0x000000ff, FALSE), 52 HOWTO ( 5, 0, 1, 16, TRUE, 0, complain_overflow_signed, MY(generic_reloc),"DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE), 53 HOWTO ( 6, 0, 2, 32, TRUE, 0, complain_overflow_signed, MY(generic_reloc),"DISP32", TRUE, 0xffffffff,0xffffffff, FALSE), 54 HOWTO ( 7, 0, 4, 64, TRUE, 0, complain_overflow_signed, MY(generic_reloc),"DISP64", TRUE, 0xfeedface,0xfeedface, FALSE), 55 HOWTO ( 8, 0, 2, 0, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"GOT_REL", FALSE, 0,0x00000000, FALSE), 56 HOWTO ( 9, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"BASE16", FALSE,0xffffffff,0xffffffff, FALSE), 57 HOWTO (10, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"BASE32", FALSE,0xffffffff,0xffffffff, FALSE), 58 EMPTY_HOWTO (-1), 59 EMPTY_HOWTO (-1), 60 EMPTY_HOWTO (-1), 61 EMPTY_HOWTO (-1), 62 EMPTY_HOWTO (-1), 63 HOWTO (16, 0, 2, 0, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"JMP_TABLE", FALSE, 0,0x00000000, FALSE), 64 EMPTY_HOWTO (-1), 65 EMPTY_HOWTO (-1), 66 EMPTY_HOWTO (-1), 67 EMPTY_HOWTO (-1), 68 EMPTY_HOWTO (-1), 69 EMPTY_HOWTO (-1), 70 EMPTY_HOWTO (-1), 71 EMPTY_HOWTO (-1), 72 EMPTY_HOWTO (-1), 73 EMPTY_HOWTO (-1), 74 EMPTY_HOWTO (-1), 75 EMPTY_HOWTO (-1), 76 EMPTY_HOWTO (-1), 77 EMPTY_HOWTO (-1), 78 EMPTY_HOWTO (-1), 79 HOWTO (32, 0, 2, 0, FALSE, 0, complain_overflow_bitfield, MY(generic_reloc),"RELATIVE", FALSE, 0,0x00000000, FALSE), 80 EMPTY_HOWTO (-1), 81 EMPTY_HOWTO (-1), 82 EMPTY_HOWTO (-1), 83 EMPTY_HOWTO (-1), 84 EMPTY_HOWTO (-1), 85 EMPTY_HOWTO (-1), 86 EMPTY_HOWTO (-1), 87 HOWTO (40, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"BASEREL", FALSE, 0,0x00000000, FALSE), 88 }; 89 90 91 CONST struct aout_backend_data MY(backend_data) = { 38 92 0, /* zmagic contiguous */ 39 93 0, /* text incl header */ … … 101 155 #endif 102 156 157 103 158 /* 104 159 * Finish up the reading of an a.out file header 105 160 */ 106 staticconst bfd_target *161 const bfd_target * 107 162 MY(object_p) (abfd) 108 163 bfd *abfd; … … 135 190 return target; 136 191 } 192 193 194 reloc_howto_type * 195 MY(reloc_type_lookup) (abfd,code) 196 bfd *abfd; 197 bfd_reloc_code_real_type code; 198 { 199 #define STD(i, j) case i: return &MY(howto_table_std)[j] 200 201 if (obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE) 202 return NAME(aout,reloc_type_lookup) (abfd, code); 203 204 205 if (code == BFD_RELOC_CTOR) 206 switch (bfd_get_arch_info (abfd)->bits_per_address) 207 { 208 case 32: 209 code = BFD_RELOC_32; 210 break; 211 case 64: 212 code = BFD_RELOC_64; 213 break; 214 } 215 216 /* std relocs. */ 217 switch (code) 218 { 219 STD (BFD_RELOC_8, 0); 220 STD (BFD_RELOC_16, 1); 221 STD (BFD_RELOC_32, 2); 222 STD (BFD_RELOC_8_PCREL, 4); 223 STD (BFD_RELOC_16_PCREL, 5); 224 STD (BFD_RELOC_32_PCREL, 6); 225 STD (BFD_RELOC_16_BASEREL, 9); 226 STD (BFD_RELOC_32_BASEREL, 10); 227 default: return (reloc_howto_type *) NULL; 228 } 229 } 230 231 /* ELF relocs are against symbols. If we are producing relocateable 232 output, and the reloc is against an external symbol, and nothing 233 has given us any additional addend, the resulting reloc will also 234 be against the same symbol. In such a case, we don't want to 235 change anything about the way the reloc is handled, since it will 236 all be done at final link time. Rather than put special case code 237 into bfd_perform_relocation, all the reloc types use this howto 238 function. It just short circuits the reloc if producing 239 relocateable output against an external symbol. */ 240 241 bfd_reloc_status_type 242 MY(generic_reloc) (abfd, 243 reloc_entry, 244 symbol, 245 data, 246 input_section, 247 output_bfd, 248 error_message) 249 bfd *abfd ATTRIBUTE_UNUSED; 250 arelent *reloc_entry; 251 asymbol *symbol; 252 PTR data ATTRIBUTE_UNUSED; 253 asection *input_section; 254 bfd *output_bfd; 255 char **error_message ATTRIBUTE_UNUSED; 256 { 257 if (output_bfd != (bfd *) NULL 258 && (symbol->flags & BSF_SECTION_SYM) == 0 259 && (! reloc_entry->howto->partial_inplace 260 || reloc_entry->addend == 0)) 261 { 262 reloc_entry->address += input_section->output_offset; 263 return bfd_reloc_ok; 264 } 265 266 return bfd_reloc_continue; 267 } 268 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.