* ppc-gas: Add '+' and '-' to symbol chars list @ 2003-04-24 10:21 Nick Clifton 2003-04-24 15:15 ` H. J. Lu ` (2 more replies) 0 siblings, 3 replies; 15+ messages in thread From: Nick Clifton @ 2003-04-24 10:21 UTC (permalink / raw) To: binutils Hi Guys, The recent patches to app.c have broken GAS for the PPC. This is because the assembler is now stricter about deciding when it has encountered a symbol and the PPC port can have opcodes which include the '+' or '-' characters. (eg "blt-") This patch fixes this problem by adding these characters to the ppc specific symbol list. Cheers Nick 2003-04-24 Nick Clifton <nickc@redhat.com> * config/tc-ppc.c (ppc_symbol_chars): Define. * config/tc-ppc.h (tc_symbol_chars): Define. Index: gas/config/tc-ppc.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-ppc.c,v retrieving revision 1.67 diff -c -3 -p -w -r1.67 tc-ppc.c *** gas/config/tc-ppc.c 8 Apr 2003 23:01:47 -0000 1.67 --- gas/config/tc-ppc.c 24 Apr 2003 10:12:58 -0000 *************** const char EXP_CHARS[] = "eE"; *** 182,187 **** --- 182,191 ---- /* Characters which mean that a number is a floating point constant, as in 0d1.0. */ const char FLT_CHARS[] = "dD"; + + /* '+' and '-' can be used as postfix predicate predictors for conditional + branches. So they need to be accepted as symbol characters. */ + const char ppc_symbol_chars[] = "+-"; \f /* The target specific pseudo-ops which we support. */ Index: gas/config/tc-ppc.h =================================================================== RCS file: /cvs/src/src/gas/config/tc-ppc.h,v retrieving revision 1.20 diff -c -3 -p -w -r1.20 tc-ppc.h *** gas/config/tc-ppc.h 5 Sep 2002 00:01:18 -0000 1.20 --- gas/config/tc-ppc.h 24 Apr 2003 10:13:03 -0000 *************** do { \ *** 206,211 **** --- 206,214 ---- #endif /* OBJ_XCOFF */ + extern const char ppc_symbol_chars[]; + #define tc_symbol_chars ppc_symbol_chars + #ifdef OBJ_ELF /* Support for SHF_EXCLUDE and SHT_ORDERED */ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-24 10:21 ppc-gas: Add '+' and '-' to symbol chars list Nick Clifton @ 2003-04-24 15:15 ` H. J. Lu 2003-04-24 17:03 ` Nick Clifton 2003-04-24 23:16 ` Alan Modra 2003-04-27 23:44 ` Alan Modra 2 siblings, 1 reply; 15+ messages in thread From: H. J. Lu @ 2003-04-24 15:15 UTC (permalink / raw) To: Nick Clifton; +Cc: binutils On Thu, Apr 24, 2003 at 11:19:18AM +0100, Nick Clifton wrote: > Hi Guys, > > The recent patches to app.c have broken GAS for the PPC. This is > because the assembler is now stricter about deciding when it has > encountered a symbol and the PPC port can have opcodes which include > the '+' or '-' characters. (eg "blt-") This patch fixes this > problem by adding these characters to the ppc specific symbol list. > Would you mind adding a testcase for that? "make check" passed for me on pcc-linux. Thanks. H.J. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-24 15:15 ` H. J. Lu @ 2003-04-24 17:03 ` Nick Clifton 0 siblings, 0 replies; 15+ messages in thread From: Nick Clifton @ 2003-04-24 17:03 UTC (permalink / raw) To: H. J. Lu; +Cc: binutils Hi H.J. > Would you mind adding a testcase for that? "make check" passed for > me on pcc-linux. Good idea. Applying the patch below. Cheers Nick 2003-04-24 Nick Clifton <nickc@redhat.com> * gas/ppc/astest2.s: Add tests for conditional branches with probability indicators. * gas/ppc/astest2.d: Add expected disassembly. Index: gas/testsuite/gas/ppc/astest2.s =================================================================== RCS file: /cvs/src/src/gas/testsuite/gas/ppc/astest2.s,v retrieving revision 1.1.1.1 diff -c -3 -p -w -r1.1.1.1 astest2.s *** gas/testsuite/gas/ppc/astest2.s 3 May 1999 07:28:52 -0000 1.1.1.1 --- gas/testsuite/gas/ppc/astest2.s 24 Apr 2003 17:01:20 -0000 *************** y: .long 0 *** 50,52 **** --- 50,67 ---- .type a,@function .type b,@function .type apfour,@function + + .section ".text" + .L1: + nop + ble- 1,.L1 + bgt- 2,.L1 + ble+ 3,.L1 + bgt+ 4,.L1 + ble- 5,.L2 + bgt- 6,.L2 + ble+ 7,.L2 + bgt+ 0,.L2 + .L2: + nop: + Index: gas/testsuite/gas/ppc/astest2.d =================================================================== RCS file: /cvs/src/src/gas/testsuite/gas/ppc/astest2.d,v retrieving revision 1.2 diff -c -3 -p -w -r1.2 astest2.d *** gas/testsuite/gas/ppc/astest2.d 22 Aug 2002 05:23:43 -0000 1.2 --- gas/testsuite/gas/ppc/astest2.d 24 Apr 2003 17:01:20 -0000 *************** Disassembly of section \.text: *** 66,71 **** --- 66,80 ---- 88: 00 00 00 02 \.long 0x2 88: R_PPC_ADDR32 apfour\+0x2 8c: 00 00 00 00 \.long 0x0 + 90: 60 00 00 00 nop + 94: 40 a5 ff fc ble- cr1,90 <apfour\+0x14> + 98: 41 a9 ff f8 bgt- cr2,90 <apfour\+0x14> + 9c: 40 8d ff f4 ble\+ cr3,90 <apfour\+0x14> + a0: 41 91 ff f0 bgt\+ cr4,90 <apfour\+0x14> + a4: 40 95 00 10 ble- cr5,b4 <nop> + a8: 41 99 00 0c bgt- cr6,b4 <nop> + ac: 40 bd 00 08 ble\+ cr7,b4 <nop> + b0: 41 a1 00 04 bgt\+ b4 <nop> Disassembly of section \.data: 0+0000000 <x>: ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-24 10:21 ppc-gas: Add '+' and '-' to symbol chars list Nick Clifton 2003-04-24 15:15 ` H. J. Lu @ 2003-04-24 23:16 ` Alan Modra 2003-04-27 23:44 ` Alan Modra 2 siblings, 0 replies; 15+ messages in thread From: Alan Modra @ 2003-04-24 23:16 UTC (permalink / raw) To: Nick Clifton; +Cc: binutils On Thu, Apr 24, 2003 at 11:19:18AM +0100, Nick Clifton wrote: > The recent patches to app.c have broken GAS for the PPC. This is > because the assembler is now stricter about deciding when it has A lot of this trouble would be avoided if app.c didn't eat whitespace completely, as most of the do_scrub_chars states could disappear. You'd need to tweak all the back-ends to accept spaces in operands though. testsuite/gas/i386/white.s shows examples. Oh well.. -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-24 10:21 ppc-gas: Add '+' and '-' to symbol chars list Nick Clifton 2003-04-24 15:15 ` H. J. Lu 2003-04-24 23:16 ` Alan Modra @ 2003-04-27 23:44 ` Alan Modra 2003-04-28 4:24 ` H. J. Lu 2 siblings, 1 reply; 15+ messages in thread From: Alan Modra @ 2003-04-27 23:44 UTC (permalink / raw) To: Nick Clifton; +Cc: binutils On Thu, Apr 24, 2003 at 11:19:18AM +0100, Nick Clifton wrote: > The recent patches to app.c have broken GAS for the PPC. This is It has also broken hppa. :-( -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-27 23:44 ` Alan Modra @ 2003-04-28 4:24 ` H. J. Lu 2003-04-28 8:35 ` Nick Clifton 0 siblings, 1 reply; 15+ messages in thread From: H. J. Lu @ 2003-04-28 4:24 UTC (permalink / raw) To: Nick Clifton, binutils On Mon, Apr 28, 2003 at 09:14:06AM +0930, Alan Modra wrote: > On Thu, Apr 24, 2003 at 11:19:18AM +0100, Nick Clifton wrote: > > The recent patches to app.c have broken GAS for the PPC. This is > > It has also broken hppa. :-( > This seems to work for me. H.J. --- 2003-04-27 H.J. Lu <hjl@gnu.org> * config/tc-hppa.c (hppa_symbol_chars): New. * config/tc-hppa.h (tc_symbol_chars): Likewise. --- gas/config/tc-hppa.c.symbol 2003-01-23 09:20:47.000000000 -0800 +++ gas/config/tc-hppa.c 2003-04-27 21:19:53.000000000 -0700 @@ -622,6 +622,9 @@ static struct call_desc last_call_desc; /* handle of the OPCODE hash table */ static struct hash_control *op_hash = NULL; +/* Those characters can be suffixes of opcode names. */ +const char hppa_symbol_chars[] = ",*!?=<>"; + /* Table of pseudo ops for the PA. FIXME -- how many of these are now redundant with the overall GAS and the object file dependent tables? */ --- gas/config/tc-hppa.h.symbol 2003-02-27 11:27:09.000000000 -0800 +++ gas/config/tc-hppa.h 2003-04-27 21:10:43.000000000 -0700 @@ -106,6 +106,9 @@ extern void pa_check_eof PARAMS ((void)) #define tc_frob_label(sym) pa_define_label (sym) +extern const char hppa_symbol_chars[]; +#define tc_symbol_chars hppa_symbol_chars + /* The PA does not need support for either of these. */ #define tc_crawl_symbol_chain(headers) {;} #define tc_headers_hook(headers) {;} ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-28 4:24 ` H. J. Lu @ 2003-04-28 8:35 ` Nick Clifton 2003-04-29 5:30 ` Alan Modra 0 siblings, 1 reply; 15+ messages in thread From: Nick Clifton @ 2003-04-28 8:35 UTC (permalink / raw) To: H. J. Lu; +Cc: binutils Hi H.J. > > It has also broken hppa. :-( > > This seems to work for me. > 2003-04-27 H.J. Lu <hjl@gnu.org> > > * config/tc-hppa.c (hppa_symbol_chars): New. > * config/tc-hppa.h (tc_symbol_chars): Likewise. Indeed it does. I have applied your patch to mainline and the branch. Cheers Nick ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-28 8:35 ` Nick Clifton @ 2003-04-29 5:30 ` Alan Modra 2003-04-29 11:55 ` Nick Clifton 0 siblings, 1 reply; 15+ messages in thread From: Alan Modra @ 2003-04-29 5:30 UTC (permalink / raw) To: Nick Clifton; +Cc: H. J. Lu, binutils On Mon, Apr 28, 2003 at 09:32:41AM +0100, Nick Clifton wrote: > Hi H.J. > > > > It has also broken hppa. :-( > > > > This seems to work for me. > > > 2003-04-27 H.J. Lu <hjl@gnu.org> > > > > * config/tc-hppa.c (hppa_symbol_chars): New. > > * config/tc-hppa.h (tc_symbol_chars): Likewise. > > Indeed it does. I have applied your patch to mainline and the branch. It's still broken. $ cat xxx.s .data .type x,@object .size x,4 x: .word 12 .symver x, x@VERS.0 $ gas/as-new xxx.s xxx.s: Assembler messages: xxx.s:6: Error: missing version name in `' for symbol `x' xxx.s:6: Warning: rest of line ignored; first ignored character is ` ' -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-29 5:30 ` Alan Modra @ 2003-04-29 11:55 ` Nick Clifton 2003-04-29 16:06 ` H. J. Lu 0 siblings, 1 reply; 15+ messages in thread From: Nick Clifton @ 2003-04-29 11:55 UTC (permalink / raw) To: Alan Modra; +Cc: H. J. Lu, binutils Hi Alan, > It's still broken. > > $ cat xxx.s > .data > .type x,@object > .size x,4 > x: > .word 12 > .symver x, x@VERS.0 > $ gas/as-new xxx.s > xxx.s: Assembler messages: > xxx.s:6: Error: missing version name in `' for symbol `x' > xxx.s:6: Warning: rest of line ignored; first ignored character is ` ' The patch below takes care of this problem. It does raise an issue though - are there other places where we need to insert a SKIP_WHITESPACE ? I ma also including an addition to the testsuite to check for this bug. I will check the patches into the branch as well. Cheers Nick gas/ChangeLog 2003-04-29 Nick Clifton <nickc@redhat.com> * config/obj-elf.c (obj_elf_symver): Skip whitespace before the start of a version name. gas/testsuite/ChangeLog 2003-04-29 Nick Clifton <nickc@redhat.com> * gas/elf/elf.exp: Invoke symver test. * gas/elf/symver.s: New test case. * gas/elf/symver.d: Expected output. Index: gas/config/obj-elf.c =================================================================== RCS file: /cvs/src/src/gas/config/obj-elf.c,v retrieving revision 1.62 diff -c -3 -p -w -r1.62 obj-elf.c *** gas/config/obj-elf.c 4 Feb 2003 12:34:08 -0000 1.62 --- gas/config/obj-elf.c 29 Apr 2003 10:53:34 -0000 *************** obj_elf_symver (ignore) *** 1269,1274 **** --- 1269,1275 ---- } ++input_line_pointer; + SKIP_WHITESPACE (); name = input_line_pointer; /* Temporarily include '@' in symbol names. */ Index: testsuite/gas/elf/elf.exp =================================================================== RCS file: /cvs/src/src/gas/testsuite/gas/elf/elf.exp,v retrieving revision 1.15 diff -c -3 -p -w -r1.15 elf.exp *** testsuite/gas/elf/elf.exp 25 Mar 2003 20:55:59 -0000 1.15 --- testsuite/gas/elf/elf.exp 29 Apr 2003 11:48:22 -0000 *************** if { ([istarget "*-*-elf*"] *** 53,56 **** --- 53,57 ---- run_dump_test "section0" run_dump_test "section1" run_list_test "section2" "$target_machine" "-al" + run_dump_test "symver" } *** /dev/null Thu Jan 30 10:24:37 2003 --- testsuite/gas/elf/symver.s Tue Apr 29 11:53:03 2003 *************** *** 0 **** --- 1,6 ---- + .data + .type x,@object + .size x,4 + x: + .word 12 + .symver x, x@VERS.0 *** /dev/null Thu Jan 30 10:24:37 2003 --- testsuite/gas/elf/symver.d Tue Apr 29 12:37:44 2003 *************** *** 0 **** --- 1,17 ---- + #objdump: --syms + #name: ELF symbol versioning + # + # The #... and #pass are there to match extra symbols inserted by + # some toolchains, eg the mips-elf port will add .reginfo and .ptrd + + dump.o: file format .* + + SYMBOL TABLE: + + 0+000 l.*d.*\.text.*0+000.* + 0+000 l.*d.*\.data.*0+000.* + 0+000 l.*d.*\.bss.*0+000.* + #... + 0+000 l.*O.*\.data.*0+004 x + 0+000 l.*O.*\.data.*0+004 x@VERS\.0 + #pass ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-29 11:55 ` Nick Clifton @ 2003-04-29 16:06 ` H. J. Lu 2003-04-29 23:33 ` Alan Modra 0 siblings, 1 reply; 15+ messages in thread From: H. J. Lu @ 2003-04-29 16:06 UTC (permalink / raw) To: Nick Clifton; +Cc: Alan Modra, binutils On Tue, Apr 29, 2003 at 12:51:41PM +0100, Nick Clifton wrote: > Hi Alan, > > > It's still broken. > > > > $ cat xxx.s > > .data > > .type x,@object > > .size x,4 > > x: > > .word 12 > > .symver x, x@VERS.0 > > $ gas/as-new xxx.s > > xxx.s: Assembler messages: > > xxx.s:6: Error: missing version name in `' for symbol `x' > > xxx.s:6: Warning: rest of line ignored; first ignored character is ` ' > > The patch below takes care of this problem. > > It does raise an issue though - are there other places where we need > to insert a SKIP_WHITESPACE ? > We will know when someone complains :-(. H.J. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-29 16:06 ` H. J. Lu @ 2003-04-29 23:33 ` Alan Modra 2003-04-30 0:39 ` Daniel Jacobowitz 0 siblings, 1 reply; 15+ messages in thread From: Alan Modra @ 2003-04-29 23:33 UTC (permalink / raw) To: H. J. Lu; +Cc: Nick Clifton, binutils On Tue, Apr 29, 2003 at 09:06:14AM -0700, H. J. Lu wrote: > On Tue, Apr 29, 2003 at 12:51:41PM +0100, Nick Clifton wrote: > > It does raise an issue though - are there other places where we need > > to insert a SKIP_WHITESPACE ? Probably. Since `,' was added to tc_symbol_chars for hppa, every place we look for a comma should be checked. > We will know when someone complains :-(. I think the original and follow on patches should be reverted for the release, or only enabled for ia64. -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-29 23:33 ` Alan Modra @ 2003-04-30 0:39 ` Daniel Jacobowitz 2003-04-30 4:55 ` H. J. Lu 2003-04-30 8:51 ` Nick Clifton 0 siblings, 2 replies; 15+ messages in thread From: Daniel Jacobowitz @ 2003-04-30 0:39 UTC (permalink / raw) To: H. J. Lu, Nick Clifton, binutils On Wed, Apr 30, 2003 at 09:02:58AM +0930, Alan Modra wrote: > On Tue, Apr 29, 2003 at 09:06:14AM -0700, H. J. Lu wrote: > > On Tue, Apr 29, 2003 at 12:51:41PM +0100, Nick Clifton wrote: > > > It does raise an issue though - are there other places where we need > > > to insert a SKIP_WHITESPACE ? > > Probably. Since `,' was added to tc_symbol_chars for hppa, every > place we look for a comma should be checked. > > > We will know when someone complains :-(. > > I think the original and follow on patches should be reverted for the > release, or only enabled for ia64. I agree. Would one of you mind doing this? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-30 0:39 ` Daniel Jacobowitz @ 2003-04-30 4:55 ` H. J. Lu 2003-04-30 8:46 ` Alan Modra 2003-04-30 8:51 ` Nick Clifton 1 sibling, 1 reply; 15+ messages in thread From: H. J. Lu @ 2003-04-30 4:55 UTC (permalink / raw) To: Nick Clifton, binutils On Tue, Apr 29, 2003 at 08:39:20PM -0400, Daniel Jacobowitz wrote: > On Wed, Apr 30, 2003 at 09:02:58AM +0930, Alan Modra wrote: > > On Tue, Apr 29, 2003 at 09:06:14AM -0700, H. J. Lu wrote: > > > On Tue, Apr 29, 2003 at 12:51:41PM +0100, Nick Clifton wrote: > > > > It does raise an issue though - are there other places where we need > > > > to insert a SKIP_WHITESPACE ? > > > > Probably. Since `,' was added to tc_symbol_chars for hppa, every > > place we look for a comma should be checked. > > > > > We will know when someone complains :-(. > > > > I think the original and follow on patches should be reverted for the > > release, or only enabled for ia64. > > I agree. Would one of you mind doing this? > Don't worry about ia64. You can back out all those patches. I found more obscure ia64 bugs. I will fix them on mainline. H.J. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-30 4:55 ` H. J. Lu @ 2003-04-30 8:46 ` Alan Modra 0 siblings, 0 replies; 15+ messages in thread From: Alan Modra @ 2003-04-30 8:46 UTC (permalink / raw) To: H. J. Lu; +Cc: Nick Clifton, binutils On Tue, Apr 29, 2003 at 09:55:14PM -0700, H. J. Lu wrote: > On Tue, Apr 29, 2003 at 08:39:20PM -0400, Daniel Jacobowitz wrote: > > On Wed, Apr 30, 2003 at 09:02:58AM +0930, Alan Modra wrote: > > > I think the original and follow on patches should be reverted for the > > > release, or only enabled for ia64. > > > > I agree. Would one of you mind doing this? > > Don't worry about ia64. You can back out all those patches. I found > more obscure ia64 bugs. I will fix them on mainline. Done. -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ppc-gas: Add '+' and '-' to symbol chars list 2003-04-30 0:39 ` Daniel Jacobowitz 2003-04-30 4:55 ` H. J. Lu @ 2003-04-30 8:51 ` Nick Clifton 1 sibling, 0 replies; 15+ messages in thread From: Nick Clifton @ 2003-04-30 8:51 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: H. J. Lu, binutils Hi Daniel, > > I think the original and follow on patches should be reverted for the > > release, or only enabled for ia64. > > I agree. Would one of you mind doing this? Alan beat me to it :-) Cheers Nick ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2003-04-30 8:51 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-04-24 10:21 ppc-gas: Add '+' and '-' to symbol chars list Nick Clifton 2003-04-24 15:15 ` H. J. Lu 2003-04-24 17:03 ` Nick Clifton 2003-04-24 23:16 ` Alan Modra 2003-04-27 23:44 ` Alan Modra 2003-04-28 4:24 ` H. J. Lu 2003-04-28 8:35 ` Nick Clifton 2003-04-29 5:30 ` Alan Modra 2003-04-29 11:55 ` Nick Clifton 2003-04-29 16:06 ` H. J. Lu 2003-04-29 23:33 ` Alan Modra 2003-04-30 0:39 ` Daniel Jacobowitz 2003-04-30 4:55 ` H. J. Lu 2003-04-30 8:46 ` Alan Modra 2003-04-30 8:51 ` Nick Clifton
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).