summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Cypriani <mcy@lm7.fr>2014-09-07 12:17:40 -0400
committerMatteo Cypriani <mcy@lm7.fr>2014-09-07 12:17:40 -0400
commit48a8b1a3bdf70bcbfe295a22f33464f8f56590ea (patch)
treef4d1f4e634cb51d1c7d7bf09899042578111bcd5
parentc23b49885426f043d0dff7658deb6dc7ef82149d (diff)
Imported Upstream version 0.9.27~git20140907.87d879a
-rw-r--r--Makefile2
-rw-r--r--lib/Makefile4
-rw-r--r--tccelf.c7
-rw-r--r--tests/Makefile4
-rw-r--r--tests/tests2/Makefile4
5 files changed, 17 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 4f18567..7796883 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ TOP ?= .
include $(TOP)/config.mak
VPATH = $(top_srcdir)
-CPPFLAGS = -I$(TOP) # for config.h
+CPPFLAGS += -I$(TOP) # for config.h
ifeq (-$(findstring gcc,$(CC))-,-gcc-)
ifeq (-$(findstring $(GCC_MAJOR),01)-,--)
diff --git a/lib/Makefile b/lib/Makefile
index e9e12f1..37d4711 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -54,6 +54,10 @@ WIN64_O = $(X86_64_O) crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
# into shared libraries
PICFLAGS = -fPIC
+# don't compile with -fstack-protector-strong, TCC doesn't handle it
+# correctly
+CFLAGS := $(filter-out -fstack-protector-strong,$(CFLAGS))
+
ifeq "$(TARGET)" "i386-win32"
OBJ = $(addprefix $(DIR)/,$(WIN32_O))
TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
diff --git a/tccelf.c b/tccelf.c
index 2fbe692..02caa68 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -1844,8 +1844,8 @@ struct dyn_inf {
/* Assign sections to segments and decide how are sections laid out when loaded
in memory. This function also fills corresponding program headers. */
static int layout_sections(TCCState *s1, ElfW(Phdr) *phdr, int phnum,
- Section *interp, struct dyn_inf *dyninf,
- int *sec_order)
+ Section *interp, Section* strsec,
+ struct dyn_inf *dyninf, int *sec_order)
{
int i, j, k, file_type, sh_order_index, file_offset;
unsigned long s_align;
@@ -2428,7 +2428,8 @@ static int elf_output_file(TCCState *s1, const char *filename)
phdr = tcc_mallocz(phnum * sizeof(ElfW(Phdr)));
/* compute section to program header mapping */
- file_offset = layout_sections(s1, phdr, phnum, interp, &dyninf, sec_order);
+ file_offset = layout_sections(s1, phdr, phnum, interp, strsec, &dyninf,
+ sec_order);
/* Fill remaining program header and finalize relocation related to dynamic
linking. */
diff --git a/tests/Makefile b/tests/Makefile
index e3824ba..e6c5660 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -7,6 +7,10 @@ include $(TOP)/Makefile
SRCDIR = $(top_srcdir)/tests
VPATH = $(SRCDIR) $(top_srcdir)
+# clear CFLAGS and LDFLAGS
+CFLAGS :=
+LDFLAGS :=
+
# what tests to run
TESTS = \
hello-exe \
diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile
index bfd37e5..66d2f5a 100644
--- a/tests/tests2/Makefile
+++ b/tests/tests2/Makefile
@@ -1,6 +1,10 @@
TOP = ../..
include $(TOP)/Makefile
+# clear CFLAGS and LDFLAGS
+CFLAGS :=
+LDFLAGS :=
+
ifdef CONFIG_WIN32
TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
else