This is the mail archive of the mailing list for the gas2 project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: fixing i386 gas for 16-bit code

   Date: Thu, 20 Jun 96 12:25:13 MDT
   From: Bryan Ford <>

   True, although there is one separate but related problem, if you're using
   ELF format...  The current ELF tools (maybe the i386 ELF format period,
   I don't know) don't seem to support 16-bit relocations in object files;
   the assembler just dies with an error.  This can usually be worked around
   by either just using 32-bit addresses in cases in which relocations are
   needed, or, in single-file "programs" such as boot blocks and such,
   just writing the code so that the assembler does the relocating rather
   than the linker - e.g., say "foo-_start" rather than just "foo".
   However, fixing this properly presumably would involve BFD hacking.

The BFD side of this is quite trivial: in elf32-i386.c, add an entry
to enum reloc_type, elf_howto_table, and elf_i386_reloc_type_lookup.

Of course, you then have to worry about the fact that your object
files violate the ELF ABI.