te-freebsd.h has #define LOCAL_LABELS_DOLLAR 1 But LOCAL_LABELS_DOLLAR never really works completely for x86 assembler. When assembler sees $foo, it can't tell if $foo is a label or the value of symbol foo. I do have a hack for x86 assembler, which assumes $_XXX is a local label if LOCAL_LABELS_DOLLAR is defined. But it won't work when _XXX is a real label. bash-3.2$ cat /tmp/f.s $foo: movl $foo(%eax), %eax bash-3.2$ ./as-new -o f.o /tmp/f.s /tmp/f.s: Assembler messages: /tmp/f.s:2: Error: junk `(%eax)' after expression bash-3.2$ I think LOCAL_LABELS_DOLLAR should be undefined for all x86 targets.
When '$' is used as the immediate prefix, LOCAL_LABELS_DOLLAR should be 0.
A patch is posted at http://sourceware.org/ml/binutils/2009-03/msg00008.html
Subject: Bug 9915 CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2009-03-09 18:33:42 Modified files: gas : ChangeLog gas/config : tc-i386.h Log message: 2009-03-09 H.J. Lu <hongjiu.lu@intel.com> PR gas/9915 * config/tc-i386.h (LOCAL_LABELS_DOLLAR): New. Defined as 0. (LOCAL_LABELS_FB): Undefine befoe define. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.3760&r2=1.3761 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-i386.h.diff?cvsroot=src&r1=1.101&r2=1.102
Fixed.