mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
sparc: Validate VDSO for undefined symbols.
There should be no undefined symbols in the resulting VDSO image(s). On sparc, fixed register usage can result in undefined symbols ending up in the image. To combat this, we do two things: 1) Define current_thread_info() specially when BUILD_DSO. 2) Ignore "#scratch" register undefined symbols in the output. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -121,8 +121,12 @@ struct thread_info {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* how to get the thread information struct from C */
|
/* how to get the thread information struct from C */
|
||||||
|
#ifndef BUILD_VDSO
|
||||||
register struct thread_info *current_thread_info_reg asm("g6");
|
register struct thread_info *current_thread_info_reg asm("g6");
|
||||||
#define current_thread_info() (current_thread_info_reg)
|
#define current_thread_info() (current_thread_info_reg)
|
||||||
|
#else
|
||||||
|
extern struct thread_info *current_thread_info(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* thread information allocation */
|
/* thread information allocation */
|
||||||
#if PAGE_SHIFT == 13
|
#if PAGE_SHIFT == 13
|
||||||
|
@@ -111,7 +111,8 @@ $(obj)/vdso32.so.dbg: FORCE \
|
|||||||
quiet_cmd_vdso = VDSO $@
|
quiet_cmd_vdso = VDSO $@
|
||||||
cmd_vdso = $(LD) -nostdlib -o $@ \
|
cmd_vdso = $(LD) -nostdlib -o $@ \
|
||||||
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
|
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
|
||||||
-T $(filter %.lds,$^) $(filter %.o,$^)
|
-T $(filter %.lds,$^) $(filter %.o,$^) && \
|
||||||
|
sh $(srctree)/$(src)/checkundef.sh '$(OBJDUMP)' '$@'
|
||||||
|
|
||||||
VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
|
VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
|
||||||
$(call ld-option, --build-id) -Bsymbolic
|
$(call ld-option, --build-id) -Bsymbolic
|
||||||
|
10
arch/sparc/vdso/checkundef.sh
Normal file
10
arch/sparc/vdso/checkundef.sh
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
objdump="$1"
|
||||||
|
file="$2"
|
||||||
|
$objdump -t "$file" | grep '*UUND*' | grep -v '#scratch' > /dev/null 2>&1
|
||||||
|
if [ $? -eq 1 ]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "$file: undefined symbols found" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
Reference in New Issue
Block a user