libnosys/warning.h: fix asm line delimiter
Hans-Peter Nilsson
hans-peter.nilsson@axis.com
Fri Jan 14 15:28:00 GMT 2005
The ";" character is *not* a universal assembly line delimiter.
It is target-dependant, and has to be autoconfed in the general
case. For CRIS and the hppa, it's a start-of-comment character.
I seem in gas that the same goes for more than a dozen targets.
I guess it's just luck that none of them use libnosys/warning.h.
Glibc has it target-configurable because it needs to emit single
assembly lines. In this case however, it's alright to emit more
than one assembly line, so that's what I suggest. (By default,
GCC uses "\n\t" to delimit its insn output, but FWIW I thought
the space is just as good to keep and slightly more readable.)
Without this patch, I see (cut-n-pasted) for cris-axis-elf:
/home/hp/cvs_areas/combined/cris-obj/gcc/xgcc -B/home/hp/cvs_areas/combined/cris-obj/gcc/ -nostdinc\
-B/home/hp/cvs_areas/combined/cris-obj/cris-unknown-elf/newlib/ -isystem /home/hp/cvs_areas/combin\
ed/cris-obj/cris-unknown-elf/newlib/targ-include -isystem /home/hp/cvs_areas/combined/combined/newl\
ib/libc/include -B/tmp/cris/cris-unknown-elf/bin/ -B/tmp/cris/cris-unknown-elf/lib/ -isystem /tmp/c\
ris/cris-unknown-elf/include -isystem /tmp/cris/cris-unknown-elf/sys-include -L/home/hp/cvs_areas/c\
ombined/cris-obj/ld -O2 -g -I. -I/home/hp/cvs_areas/combined/combined/libgloss/cris/.. `if [ -d ./\
../../newlib ]; then echo -I./../../newlib/targ-include -I/home/hp/cvs_areas/combined/combined/libg\
loss/cris/../../newlib/libc/include; fi` -O2 -I. -I/home/hp/cvs_areas/combined/combined/libgloss/cr\
is/.. -c -O2 -g -O2 /home/hp/cvs_areas/combined/combined/libgloss/cris/close.c
/home/hp/cvs_areas/combined/cris-obj/gcc/xgcc -B/home/hp/cvs_areas/combined/cris-obj/gcc/ -nostdinc\
-B/home/hp/cvs_areas/combined/cris-obj/cris-unknown-elf/newlib/ -isystem /home/hp/cvs_areas/combin\
ed/cris-obj/cris-unknown-elf/newlib/targ-include -isystem /home/hp/cvs_areas/combined/combined/newl\
ib/libc/include -B/tmp/cris/cris-unknown-elf/bin/ -B/tmp/cris/cris-unknown-elf/lib/ -isystem /tmp/c\
ris/cris-unknown-elf/include -isystem /tmp/cris/cris-unknown-elf/sys-include -L/home/hp/cvs_areas/c\
ombined/cris-obj/ld -O2 -g -I. -I/home/hp/cvs_areas/combined/combined/libgloss/cris/.. `if [ -d ./\
../../newlib ]; then echo -I./../../newlib/targ-include -I/home/hp/cvs_areas/combined/combined/libg\
loss/cris/../../newlib/libc/include; fi` -O2 -I. -I/home/hp/cvs_areas/combined/combined/libgloss/cr\
is/.. -c -O2 -g -O2 /home/hp/cvs_areas/combined/combined/libgloss/cris/execve.c
/tmp/ccQCsAcs.s: Assembler messages:
/tmp/ccQCsAcs.s:80: Error: operation combines symbols in different segments
... (more of the same error)
2005-01-14 Hans-Peter Nilsson <hp@axis.com>
* libnosys/warning.h (__make_section_unallocated)
[HAVE_ASM_PREVIOUS_DIRECTIVE, HAVE_ASM_POPSECTION_DIRECTIVE]: Use "\n"
instead of ";" to delimit assembly lines.
Index: warning.h
===================================================================
RCS file: /cvs/src/src/libgloss/libnosys/warning.h,v
retrieving revision 1.2
diff -c -p -r1.2 warning.h
*** warning.h 11 May 2002 20:48:04 -0000 1.2
--- warning.h 14 Jan 2005 15:03:14 -0000
***************
*** 7,16 ****
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
# define __make_section_unallocated(section_string) \
! asm(".section " section_string "; .previous");
# elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
# define __make_section_unallocated(section_string) \
! asm(".pushsection " section_string "; .popsection");
# else
# define __make_section_unallocated(section_string)
# endif
--- 7,16 ----
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
# define __make_section_unallocated(section_string) \
! asm(".section " section_string "\n .previous");
# elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
# define __make_section_unallocated(section_string) \
! asm(".pushsection " section_string "\n .popsection");
# else
# define __make_section_unallocated(section_string)
# endif
brgds, H-P
More information about the Newlib
mailing list