This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [2.11 branch]: Failures for armv4l-unknown-linux-gnu
- To: Manfred Hollstein <manfred dot h at gmx dot net>
- Subject: Re: [2.11 branch]: Failures for armv4l-unknown-linux-gnu
- From: Philip Blundell <philb at gnu dot org>
- Date: Fri, 02 Feb 2001 22:30:18 +0000
- cc: binutils at sources dot redhat dot com
- References: <14964.10269.700126.391586@saturn.hollstein.net>
>ld/ld.log:
>/home/gnu/work/GNU/binutils-2.11-armv4l-unknown-linux-gnu/ld/../binutils/nm-ne
>w tmpdir/2.x >tmpdir/nm.out
>selective3: missing foo
>FAIL: selective3
>[...]
>/home/gnu/work/GNU/binutils-2.11-armv4l-unknown-linux-gnu/ld/../binutils/nm-ne
>w tmpdir/3.x >tmpdir/nm.out
>selective4: missing start
>FAIL: selective4
I think both of these are caused by gcc problems; arguably this is also a flaw
in the testsuite. The compiler isn't putting the `.text' prefix on section
names, which causes the assembler to fumble the symbol type information.
Which in turn makes things show up as `?' rather than `T' in nm, and this
spooks out the `nm_output' function. The patch below ought to fix it; this is
already in the trunk.
p.
Index: linux-elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/linux-elf.h,v
retrieving revision 1.7.4.5
diff -u -p -u -r1.7.4.5 linux-elf.h
--- linux-elf.h 2000/12/29 16:08:46 1.7.4.5
+++ linux-elf.h 2001/02/02 22:28:57
@@ -223,6 +223,44 @@ const_section () \
go into the const section. */
#define SELECT_RTX_SECTION(MODE,RTX) const_section ()
+#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+
+#define UNIQUE_SECTION(DECL, RELOC) \
+ do \
+ { \
+ int len; \
+ char * name; \
+ char * string; \
+ char * prefix; \
+ \
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ \
+ if (! DECL_ONE_ONLY (DECL)) \
+ { \
+ prefix = "."; \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".text."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".rodata."; \
+ else \
+ prefix = ".data."; \
+ } \
+ else if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".gnu.linkonce.t."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".gnu.linkonce.r."; \
+ else \
+ prefix = ".gnu.linkonce.d."; \
+ \
+ len = strlen (name) + strlen (prefix); \
+ string = alloca (len + 1); \
+ sprintf (string, "%s%s", prefix, name); \
+ \
+ DECL_SECTION_NAME (DECL) = build_string (len, string); \
+ } \
+ while (0)
+
/* On svr4, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
crtstuff.c and other files know this by defining the following symbols.