The thing inside of us that makes us go up is our attitude.

Thoughts and learnings

Random Image

Who's Online

We have 10 guests online

Statistics

Members : 2
Content : 182
Web Links : 6
Content View Hits : 224632



Porting binutils to a new architecture PDF Print E-mail
Written by Chandra Kumar R   


The configuration files that needs to be modified with respect to the target architecture are as follows:

  1. gas/configure.in
  2. opcodes/configure.in
  3. bfd/configure.in
  4. bfd/config.bfd
  5. bfd/archures.c
  6. bfd/reloc.c
  7. ld/configure.in
  8. ld/configure.tgt
  9. include/dis-asm.h


And the files that needs to be added/created for porting binutils to a new architecture are as follows

  1. gas/config/tc-<target>.h
    • Customisation of generic parts of the assembler
  2. gas/config/tc-<target>.c
    • Port specific parts of the assembler
  3. include/{coff|elf}/<target>.h
    • Port specific header file
  4. include/opcodes/<target>.h
    • Port specific ISA encoding
  5. opcodes/<target>-dis.c
    • Port specific disassembler routines
  6. opcodes/<target>-opc.c
    • Port specific ISA encoding
  7. bfd/{elf32|coff}-<target>.c
    • Port specific relocation handlers
  8. bfd/cpu-<target>.c
    • Port specific description of the CPU
  9. ld/scripttempl/<target>.sc
    • Port specific linker template file
  10. ld/emulparam/<target>.sh
    • Port specific linker customisation


Among the above files to be generated, the following files can be generated using the CGEN (CGEN, expands to Cpu tools GENerator. It is a framework for developing generators of CPU-related tools such as assemblers, disassemblers and simulators):

  1. include/opcodes/<target>.h
    • Port specific ISA encoding
  2. opcodes/<target>-dis.c
    • Port specific disassembler routines
  3. opcodes/<target>-opc.c
    • Port specific ISA encoding


The above listed files are the most complex aspect for supporting the target architecture. Rest all the files need to be generated manually.

 

References: