From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: gas2@cygnus.com Cc: meissner@cygnus.com Subject: gas-950822/powerpcle-unknown-eabisim - `gas -mbig' still little ... Date: Wed, 30 Aug 1995 13:36:00 -0000 Message-id: <199508301450.AAA08567@puddin.highland.com.au> X-SW-Source: 1995/msg00159.html Hello, This one has puzzled me for a while. Gas, when configured for LE PowerPC, should still be able to generate BE object files. Mysteriously it doesn't. (ditto for BE configured gas generating LE object files). For instance, the assembler: bash$ cat t.s .text .long 0x12345678 bash$ ./as.new -o t.o -mbig -v t.s GNU assembler version 950822 (powerpcle-unknown-eabisim), using BFD version cygnus-2.5 would give: bash$ powerpcle-unknown-eabisim-objdump -d t.o t.o: file format elf32-powerpc No symbols in "t.o". Disassembly of section .text: 00000000 rldcr r22,r2,r6,16 instead of: bash$ powerpcle-unknown-eabisim-objdump -d t.o t.o: file format elf32-powerpc No symbols in "t.o". Disassembly of section .text: 00000000 .long 0x12345678 Seems that md_begin() was clobering md_parse_arg()'s setting of target_big_endian. The patch below hopefully fixes this and also elimates what I think are now redundant header definitions. Andrew *** gas-950822/gas/SRC/ChangeLog Mon Aug 28 19:47:32 1995 --- gas-950822/gas/ChangeLog Thu Aug 31 00:10:56 1995 *************** *** 1,3 **** --- 1,17 ---- + Thu Aug 31 00:00:38 1995 Andrew Cagney - aka Noid + + * config/tc-ppc.h: Eliminate redundant definitions of + TARGET_BYTES_BIG_ENDIAN, TARGET_BYTES_LITTLE_ENDIAN and + PPC_BIG_ENDIAN. The variable target_big_endian now contains this + information and is set in read.c/tc-ppc.c. + + Perhaphs even `target_big_endian' should be initialised from + stdoutput->xvec->byteorder_big_p. + + * config/tc-ppc.c (md_begin): Delete code incorrectly setting the + variable `target_big_endian' to PPC_BIG_ENDIAN. This is now done + by read.c/tc-ppc.c. + Tue Aug 22 03:00:33 1995 Ken Raeburn Sat Aug 19 18:08:16 1995 Pat Rankin *** gas-950822/gas/config/SRC/tc-ppc.h Fri Aug 18 19:23:22 1995 --- gas-950822/gas/config/tc-ppc.h Wed Aug 30 23:51:49 1995 *************** *** 63,81 **** #define DIFF_EXPR_OK /* .-foo gets turned into PC relative relocs */ #endif - /* Set the endianness we are using. Default to big endian. */ - #ifndef TARGET_BYTES_BIG_ENDIAN - #ifndef TARGET_BYTES_LITTLE_ENDIAN - #define TARGET_BYTES_BIG_ENDIAN 1 - #endif - #endif - - #ifdef TARGET_BYTES_BIG_ENDIAN - #define PPC_BIG_ENDIAN 1 - #else - #define PPC_BIG_ENDIAN 0 - #endif - /* We don't need to handle .word strangely. */ #define WORKING_DOT_WORD --- 63,68 ---- *** gas-950822/gas/config/SRC/tc-ppc.c Mon Aug 28 19:47:41 1995 --- gas-950822/gas/config/tc-ppc.c Wed Aug 30 23:47:27 1995 *************** *** 436,444 **** } } - /* Tell the main code what the endianness is. */ - target_big_endian = PPC_BIG_ENDIAN; - #ifdef OBJ_COFF ppc_coff_debug_section = coff_section_from_bfd_index (stdoutput, N_DEBUG); --- 436,441 ----