From 925a60f3e755a997ede77129429b001e4d3357ca Mon Sep 17 00:00:00 2001 From: Philip Blundell Date: Thu, 25 Mar 1999 09:45:15 +0000 Subject: [PATCH] Applied patch from Phillip Blundell : This patch fixes a couple of Linux-specific problems with profiling and debugging. It's against the trunk version. Without it gdb reports wrong line numbers and -pg does not work at all. From-SVN: r25972 --- gcc/ChangeLog | 7 +++++++ gcc/config/arm/linux-elf.h | 36 ++++++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ab608747a66..cc4577a1bdb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +1999-03-25 Philip Blundell + + Based on patch from Jim Studt : + * config/arm/linux-elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Copy + definitions from config/linux.h. + (DBX_BLOCKS_FUNCTION_RELATIVE): Define to 1. + Thu Mar 25 02:12:42 1999 Finn Hakansson * rtl.h (MEM_COPY_ATTRIBUTES): Remove unnecessary ending backslash. diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index 97caad5da62..585c259f0b8 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -49,13 +49,26 @@ Boston, MA 02111-1307, USA. */ #define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc" -/* Add the compiler's crtend, and the library's crtn. */ -#define ENDFILE_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \ - %{pg:gcrtn.o%s}%{!pg:crtn.o%s}" - -#define STARTFILE_SPEC "%{!shared:crt1.o%s} \ - crti.o%s \ - %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" +/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add + the GNU/Linux magical crtbegin.o file (see crtstuff.c) which + provides part of the support for getting C++ file-scope static + object constructed before entering `main'. */ + +#define STARTFILE_SPEC \ + "%{!shared: \ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ + %{!p:%{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ + crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" + +/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on + the GNU/Linux magical crtend.o file (see crtstuff.c) which + provides part of the support for getting C++ file-scope static + object constructed before entering `main', followed by a normal + GNU/Linux "finalizer" file, `crtn.o'. */ + +#define ENDFILE_SPEC \ + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" #define LINK_SPEC "%{h*} %{version:-v} \ %{b} %{Wl,*:%*} \ @@ -218,9 +231,16 @@ const_section () \ fputc ('\n', FILE); } while (0) /* Make DWARF2 an option, but keep DBX as the default for now. - Use -gdwarf2 to turn on DWARF2. */ + Use -gdwarf-2 to turn on DWARF2. */ #define DWARF2_DEBUGGING_INFO #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG +/* Make LBRAC and RBRAC addresses relative to the start of the + function. The native Solaris stabs debugging format works this + way, gdb expects it, and it reduces the number of relocation + entries. */ + +#define DBX_BLOCKS_FUNCTION_RELATIVE 1 + #include "arm/elf.h" #include "arm/linux-gas.h" -- 2.30.2