
PROBLEMS THAT SOME PEOPLE HAVE ENCOUNTERED AND SOLUTIONS


1) Your 68k assembler confuses registers with varables having 
   the same names as registers.

	Define REGISTER_PREFIX as '%' to fix this.  gcc must be built
	to generate register names prefixed with the percent sign
	for this to work. (see tm-pbb.h as a guide)
-----------------------------
2) Symbol names beginning with the letter "L" seem to disappear into
   thin air. 

	Define DOT_LABEL_PREFIX to fix this.

-----------------------------   

  DOT_LABEL_PREFIX should be defined for most (if not all) 386 systems.

  Normally either both of or neither of REGISTER_PREFIX and 
  DOT_LABEL_PREFIX should be defined for 68k systems. You want
  neither on 68k systems where underscores are prepended to symbol
  names. You want both on 68k systems where no underscore is prepended.

------------------------------

3) You get a message from the loader saying 
      "Reloc entries out of order in section .text of file foo.o"

	Some older coff loaders complain when relocation entries
	are not in ascending order. gas does not generate
	relocation in this order.  If your loader issues this
	complaint, you should #define ASCENDING_RELOCS, which
	will cause the relocation entries to be sorted by address
	before being output.

------------------------------

4) You get a message from the loader saying 
      "Illegal relocation type 20 found in section .text in file foo.o"

	This can mean one of two things:
	 a)  Either different relocation type numbers are used on 
	     your system than those generated by coff-convert, 
	   or
	 b)  You have an older m68k coff loader which is unable
	     to handle pc-relative relocation entries.

	For (a), you need to determine the correct relocation types.
	Most 68K systems use R_RELLONG, R_RELWORD, and R_RELBYTE
	for direct 32, 16, and 8 bit relocations respectively.
	Some instead, however, use R_DIR32, R_DIR16, and R_DIR8.
	The relocation algorithm is the same, only the type numbers
	differ.

	All 386 systems I've seen use R_DIRnn for direct relocation.

	b) problems with pc relative relocation on a 68k system.
	   If your loader is unable to handle pc relative relocation,
	   you can #define M68K_NO_PCREL_RELOC, and the pc relative
	   relocations (and the instructions/operands being relocated)
	   will be translated to direct relocations on output. 

	All 386 systems I've seen use R_PCRLONG, R_PCRWORD, and
	R_PCRBYTE for pc relative relocation. Most 68K systems also
	use these for pc relative relocation.  If your loader supports
	pc relative relocation, but uses other type numbers than these,
	you will have to determine what types to use.  On a 68k system,
	you can determine this by creating a file "foo.s" containing the 
	single 	line:
		bsr printf
	Assemble this to create foo.o, and examine the relocation with
	"dump -r foo.o" and "dump -rv foo.o". If your loader supports
	pc relative relocation, The first will show you the numerical
	type of pc relative relocation, while the second should show you 
	the symbolic name for that type.  If the type shown is the same
	as you would get if you had used "jsr" instead of "bsr", then
	your loader does not support pc relative relocation, and you'll
	have to #define M68K_NO_PCREL_RELOC. 
	    
