| 1 | |
| 2 | The GAS Configuration Plan |
| 3 | |
| 4 | Theory: |
| 5 | |
| 6 | The goal of the new configuration scheme is to bury all object format |
| 7 | and target processor dependancies in object and target specific files. |
| 8 | That is, to move all #ifdef's out of the gas common code. |
| 9 | |
| 10 | Here's how it works. There is a .h and a .c file for each object file |
| 11 | format and a .h and a .c file for each target processor. The |
| 12 | configure script creates symlinks in the current directory to the |
| 13 | appropriate files in the config directory. configure also serves as a |
| 14 | list of triplets {host, target, object-format} that have been tested |
| 15 | at one time or another. I also recommend that configure be used to |
| 16 | document triplet specific notes as to purpose of the triplet, etc. |
| 17 | |
| 18 | Implementation: |
| 19 | |
| 20 | obj-format.h is a {sym}link to .../config/obj-something.h. It is intended |
| 21 | |
| 22 | All gas .c files include as.h. |
| 23 | |
| 24 | as.h #define's "gas", includes host.h, defines a number of gas |
| 25 | specific structures and types, and then includes tp.h, obj.h, and |
| 26 | target-environment.h. |
| 27 | |
| 28 | target-environment.h defines a target environment specific |
| 29 | preprocessor flag, eg, TE_SUN, and then includes obj-format.h. |
| 30 | |
| 31 | obj-format.h defines an object format specific preprocessor flag, eg, |
| 32 | OBJ_AOUT, OBJ_BOUT, OBJ_COFF, includes "target-processor.h", and then |
| 33 | defines the object specific macros, functions, types, and structures. |
| 34 | |
| 35 | target-processor.h |
| 36 | |
| 37 | target-processor. |
| 38 | |
| 39 | Porting: |
| 40 | |
| 41 | There appear to be four major types of ports; new hosts, new target |
| 42 | processors, new object file formats, and new target environments. |