[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250430095411-349b13bf-a3c7-4968-9f97-551a1ded1696@linutronix.de>
Date: Wed, 30 Apr 2025 09:57:02 +0200
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Jan Stancek <jstancek@...hat.com>,
Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>, Nam Cao <namcao@...utronix.de>,
Anna-Maria Behnsen <anna-maria@...utronix.de>, Andy Lutomirski <luto@...nel.org>,
Vincenzo Frascino <vincenzo.frascino@....com>, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] vdso: Reject absolute relocations during build
On Wed, Apr 30, 2025 at 09:32:27AM +0200, Thomas Gleixner wrote:
> On Tue, Apr 29 2025 at 17:17, Jan Stancek wrote:
> > On Tue, Apr 29, 2025 at 2:56 PM Thomas Weißschuh
> > <thomas.weissschuh@...utronix.de> wrote:
> >>
> >> +# Also validate that no absolute relocations are present in the object files themselves.
> >> quiet_cmd_vdso_check = VDSOCHK $@
> >> cmd_vdso_check = if $(READELF) -rW $@ | grep -v _NONE | grep -q " R_\w*_"; \
> >> then (echo >&2 "$@: dynamic relocations are not supported"; \
> >> + rm -f $@; /bin/false); fi && \
> >> + if $(READELF) -rW $(filter %.o, $(real-prereqs)) | grep -q " R_\w*_ABS"; \
> >> + then (echo >&2 "$@: absolute relocations are not supported"; \
> >> rm -f $@; /bin/false); fi
> >
> > Should this check only some sections? I'm getting lot of matches on
> > debuginfo related sections:
>
> Hmm. All architecture VDSO Makefiles have -fPIC in CFLAGS except for
> arm64, which only adds it in arm64/kernel/vdso32/Makefile but not in
> arm64/kernel/vdso/Makefile. Confused.
Unfortunately -fPIC does not help. It generates code that is sufficiently
position independent for regular DSOs, but not the vDSO.
See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120002#c5
Powered by blists - more mailing lists