aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/ChangeLog12
-rw-r--r--ld/Makefile.am16
-rw-r--r--ld/Makefile.in29
-rw-r--r--ld/ldlex-wrapper.c6
-rw-r--r--ld/ldlex.l1
5 files changed, 41 insertions, 23 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index f78771a..0260954 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-10 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * Makefile.am (CFILES): Add ldlex-wrapper.c.
+ (OFILES): Replace ldlex.c with ldlex-wrapper.c.
+ (ldlex.o): Replace with...
+ (ldlex-wrapper.o): ...this new rule.
+ (EXTRA_ld_new_SOURCES): Add ldlex.l.
+ (ld_new_SOURCES): Replace ldlex.l with ldlex-wrapper.c.
+ * Makefile.in: Regenerate.
+ * ldlex.l (sysdep.h): Don't include here.
+ * ldlex-wrapper.c: New file.
+
2010-02-09 Alan Modra <amodra@gmail.com>
* emultempl/ppc64elf.em (ppc_before_allocation): Update for changed
diff --git a/ld/Makefile.am b/ld/Makefile.am
index c1d3dbf..001f7d4 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -447,7 +447,7 @@ ALL_EMUL_EXTRA_OFILES = \
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
- mri.c ldcref.c pe-dll.c pep-dll.c
+ mri.c ldcref.c pe-dll.c pep-dll.c ldlex-wrapper.c
HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
@@ -460,7 +460,7 @@ GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
# tracking will not cause them to be built beforehand.
BUILT_SOURCES = $(GENERATED_HFILES)
-OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
+OFILES = ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES}
@@ -480,16 +480,16 @@ endif
$(COMPILE) -c `test -f ldgram.c || echo $(srcdir)/`ldgram.c $(NO_WERROR)
endif
-ldlex.o: ldlex.c
+ldlex-wrapper.o: ldlex-wrapper.c ldlex.c
if am__fastdepCC
- $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f ldlex.c || echo $(srcdir)/`ldlex.c $(NO_WERROR)
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(srcdir)/ldlex-wrapper.c $(NO_WERROR)
mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
else
if AMDEP
- source='ldlex.c' object='$@' libtool=no @AMDEPBACKSLASH@
+ source='ldlex-wrapper.c' object='$@' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif
- $(COMPILE) -c `test -f ldlex.c || echo $(srcdir)/`ldlex.c $(NO_WERROR)
+ $(COMPILE) -c $(srcdir)/ldlex-wrapper.c $(NO_WERROR)
endif
deffilep.o: deffilep.c
@@ -1837,11 +1837,11 @@ ez8002.c: $(srcdir)/emulparams/z8002.sh \
${GENSCRIPTS} z8002 "$(tdir_z8002)"
# We need this for automake to use YLWRAP.
-EXTRA_ld_new_SOURCES = deffilep.y
+EXTRA_ld_new_SOURCES = deffilep.y ldlex.l
# Allow dependency tracking to work for these files, too.
EXTRA_ld_new_SOURCES += pep-dll.c pe-dll.c
-ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
+ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP)
ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
diff --git a/ld/Makefile.in b/ld/Makefile.in
index e7f23d8..1ec64de 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -45,7 +45,7 @@ DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(srcdir)/config.in \
$(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in ldgram.h \
- ldgram.c ldlex.c deffilep.h deffilep.c $(srcdir)/../depcomp \
+ ldgram.c deffilep.h deffilep.c ldlex.c $(srcdir)/../depcomp \
$(srcdir)/../ylwrap $(ld_TEXINFOS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
@@ -74,11 +74,11 @@ CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \
"$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS)
-am_ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex.$(OBJEXT) lexsup.$(OBJEXT) \
- ldlang.$(OBJEXT) mri.$(OBJEXT) ldctor.$(OBJEXT) \
- ldmain.$(OBJEXT) ldwrite.$(OBJEXT) ldexp.$(OBJEXT) \
- ldemul.$(OBJEXT) ldver.$(OBJEXT) ldmisc.$(OBJEXT) \
- ldfile.$(OBJEXT) ldcref.$(OBJEXT)
+am_ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex-wrapper.$(OBJEXT) \
+ lexsup.$(OBJEXT) ldlang.$(OBJEXT) mri.$(OBJEXT) \
+ ldctor.$(OBJEXT) ldmain.$(OBJEXT) ldwrite.$(OBJEXT) \
+ ldexp.$(OBJEXT) ldemul.$(OBJEXT) ldver.$(OBJEXT) \
+ ldmisc.$(OBJEXT) ldfile.$(OBJEXT) ldcref.$(OBJEXT)
ld_new_OBJECTS = $(am_ld_new_OBJECTS)
am__DEPENDENCIES_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
@@ -735,7 +735,7 @@ ALL_EMUL_EXTRA_OFILES = \
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
- mri.c ldcref.c pe-dll.c pep-dll.c
+ mri.c ldcref.c pe-dll.c pep-dll.c ldlex-wrapper.c
HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
@@ -747,7 +747,7 @@ GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
# Require an early dependency on the generated headers, as the dependency
# tracking will not cause them to be built beforehand.
BUILT_SOURCES = $(GENERATED_HFILES)
-OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
+OFILES = ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES}
@@ -768,9 +768,9 @@ ELF_GEN_DEPS = $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/elf-generic.em
# Allow dependency tracking to work for these files, too.
# Dependency tracking for the generated emulation files.
-EXTRA_ld_new_SOURCES = deffilep.y pep-dll.c pe-dll.c \
+EXTRA_ld_new_SOURCES = deffilep.y ldlex.l pep-dll.c pe-dll.c \
$(ALL_EMULATIONS:.o=.c) $(ALL_64_EMULATIONS:.o=.c)
-ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
+ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP)
@@ -1244,6 +1244,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldgram.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldlang.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldlex-wrapper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldlex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldmain.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldmisc.Po@am__quote@
@@ -1862,12 +1863,12 @@ ldgram.o: ldgram.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f ldgram.c || echo $(srcdir)/`ldgram.c $(NO_WERROR)
-ldlex.o: ldlex.c
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f ldlex.c || echo $(srcdir)/`ldlex.c $(NO_WERROR)
+ldlex-wrapper.o: ldlex-wrapper.c ldlex.c
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(srcdir)/ldlex-wrapper.c $(NO_WERROR)
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldlex.c' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldlex-wrapper.c' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f ldlex.c || echo $(srcdir)/`ldlex.c $(NO_WERROR)
+@am__fastdepCC_FALSE@ $(COMPILE) -c $(srcdir)/ldlex-wrapper.c $(NO_WERROR)
deffilep.o: deffilep.c
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f deffilep.c || echo $(srcdir)/`deffilep.c $(NO_WERROR)
diff --git a/ld/ldlex-wrapper.c b/ld/ldlex-wrapper.c
new file mode 100644
index 0000000..ef2beba
--- /dev/null
+++ b/ld/ldlex-wrapper.c
@@ -0,0 +1,6 @@
+/* The flex output (ldlex.c) includes stdio.h before any of the C code
+ in ldlex.l. Make sure we include sysdep.h first, so that config.h
+ can select the correct value of things like _FILE_OFFSET_BITS and
+ _LARGE_FILES. */
+#include "sysdep.h"
+#include "ldlex.c"
diff --git a/ld/ldlex.l b/ld/ldlex.l
index c6a0254..e52d83b 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -24,7 +24,6 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
-#include "sysdep.h"
#include "bfd.h"
#include "safe-ctype.h"
#include "bfdlink.h"