This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why is _dl_relocate_static_pie linked into crt1.o?


On 07/05/2018 04:23 PM, Carlos O'Donell wrote:
Can we fix this with a subsequent CFLAGS-static-reloc.o override?

I'm hesitant to make any major changes now that we are in slushy freeze
fro the release.

Like with the attached patch?

It covers the csu/elf-init.c situation as well, assuming that we we don't want to include the startup cleanup in this release.

Thanks,
Florian
Subject: [PATCH] Build csu/elf-init.c and csu/static-reloc.c with stack protector
To: libc-alpha@sourceware.org

This does not change generated code (with -fstack-protector-strong), but
is important for formal compiler flags compliance.

2018-07-05  Florian Weimer  <fweimer@redhat.com>

	* csu/Makefile (CFLAGS-static-reloc.os): Build with stack
	protector.
	(CFLAGS-elf-init.oS): Likewise.

diff --git a/csu/Makefile b/csu/Makefile
index f3498960f8..250fe664bd 100644
--- a/csu/Makefile
+++ b/csu/Makefile
@@ -50,6 +50,19 @@ CFLAGS-.o += $(no-stack-protector)
 CFLAGS-.op += $(no-stack-protector)
 CFLAGS-.os += $(no-stack-protector)
 
+# Dummy object not actually part of anything.
+# See <https://sourceware.org/ml/libc-alpha/2018-07/msg00101.html>.
+# NB: Using $(stack-protector) in this way causes a wrong definition
+# STACK_PROTECTOR_LEVEL due to the preceding $(no-stack-protector),
+# but it does not matter for this source file.
+CFLAGS-static-reloc.os += $(stack-protector)
+
+# This file is not actually part of the startup code in the nonshared
+# case.  See <https://sourceware.org/bugzilla/show_bug.cgi?id=23323>,
+# <https://sourceware.org/ml/libc-alpha/2018-06/msg00717.html>.
+# See the NB above regarding STACK_PROTECTOR_LEVEL.
+CFLAGS-elf-init.oS += $(stack-protector)
+
 ifeq (yes,$(build-shared))
 extra-objs += S$(start-installed-name) gmon-start.os
 ifneq ($(start-installed-name),$(static-start-installed-name))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]