xref: /linux/arch/loongarch/vdso/gen_vdso_offsets.sh (revision c6b99bed6b8f3255bd2f65a8e606352e0e638ad0)
1*c6b99bedSHuacai Chen#!/bin/sh
2*c6b99bedSHuacai Chen# SPDX-License-Identifier: GPL-2.0
3*c6b99bedSHuacai Chen
4*c6b99bedSHuacai Chen#
5*c6b99bedSHuacai Chen# Derived from RISC-V and ARM64:
6*c6b99bedSHuacai Chen# Author: Will Deacon <will.deacon@arm.com>
7*c6b99bedSHuacai Chen#
8*c6b99bedSHuacai Chen# Match symbols in the DSO that look like VDSO_*; produce a header file
9*c6b99bedSHuacai Chen# of constant offsets into the shared object.
10*c6b99bedSHuacai Chen#
11*c6b99bedSHuacai Chen
12*c6b99bedSHuacai ChenLC_ALL=C sed -n -e 's/^00*/0/' -e \
13*c6b99bedSHuacai Chen's/^\([0-9a-fA-F]*\) . VDSO_\([a-zA-Z0-9_]*\)$/\#define vdso_offset_\2\t0x\1/p'
14