From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bryan Ford To: Ian Lance Taylor Cc: vax@linkdead.paranoia.com, gas2@cygnus.com Subject: Re: fixing i386 gas for 16-bit code Date: Thu, 20 Jun 1996 11:28:00 -0000 Message-id: <199606201825.MAA17992@snake.cs.utah.edu> References: <199606201546.LAA05668@sanguine.cygnus.com> X-SW-Source: 1996/msg00046.html > Date: Wed, 19 Jun 1996 00:41:40 -0500 > From: VaX#n8 > > I was wondering if you know how hard it would be (for me) to fix gas > to create 16-bit code properly, especially in the case of SIB (scaled > indexed based) addressing modes on the i386. > >I don't know much about the i386 myself, so I'm CC'ing your note to >the gas developers list, gas2@cygnus.com. Perhaps somebody on the >list will have some useful information. I don't think this would really be that difficult at all; it's just work that I didn't have enough time or motivation to do when I added the original partial support for 16-bit code. Probably the only changes necessary should be in tc-i386.h and the associated header files. > Would I have to learn bfd? It confused the heck outta me when I looked > at the bfd source last time :-/ > >You shouldn't have to look at BFD for this sort of thing. 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. Bryan