Skip to content

Commit 0bfc7b6

Browse files
committed
build: change linker script to use the .ld extension
The commom name for linker scripts uses the .ld extension, thus rename the libnvme.map to libnvme.ld Signed-off-by: Daniel Wagner <[email protected]>
1 parent 48cec73 commit 0bfc7b6

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

libnvme/scripts/release.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,18 @@ if [ "$build_doc" = true ]; then
132132
git commit -s -m "doc: Regenerate all docs for $VERSION"
133133
fi
134134

135-
declare -A maps
136-
maps=(
137-
[src/libnvme.map]=LIBNVME
135+
declare -A ldscripts
136+
ldscripts=(
137+
[src/libnvme.ld]=LIBNVME
138138
)
139139

140140
lib_ver="${ver//./_}"
141141

142-
for map_file in "${!maps[@]}"
142+
for ld_file in "${!ldscripts[@]}"
143143
do
144-
lib_name=${maps[$map_file]}
144+
lib_name=${ldscripts[$ld_file]}
145145

146-
if [ ! -f "${map_file}" ]; then
146+
if [ ! -f "${ld_file}" ]; then
147147
continue
148148
fi
149149

@@ -155,16 +155,16 @@ do
155155
in_section && $0 ~ /\}/ { exit }
156156
in_section && $0 !~ /^[[:space:]]*($|\/|\/\*|\*|#)/ { found = 1; exit }
157157
END { exit !found }
158-
' "${map_file}"; then
158+
' "${ld_file}"; then
159159
continue
160160
fi
161161

162162
sed -i \
163163
-e "s/^${lib_unreleased}\s*{/&\n};\n\n${lib_name}_${lib_ver} {/" \
164-
"$map_file"
164+
"$ld_file"
165165

166-
git add "${map_file}"
167-
echo "${map_file} updated."
166+
git add "${ld_file}"
167+
echo "${ld_file} updated."
168168
done
169169

170170
# update meson.build

libnvme/src/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ deps = [
4141
accessors_dep,
4242
]
4343

44-
mapfile = 'libnvme.map'
44+
ldfile = 'libnvme.ld'
4545

4646
libnvme = library(
4747
'nvme', # produces libnvme.so
4848
sources,
4949
version: libnvme_so_version,
5050
link_args: [
51-
'-Wl,--version-script=@0@'.format(meson.current_source_dir() / mapfile),
51+
'-Wl,--version-script=@0@'.format(meson.current_source_dir() / ldfile),
5252
'-Wl,--version-script=@0@'.format(accessors_ld_full_path),
5353
],
5454
dependencies: deps,

0 commit comments

Comments
 (0)