ldscriptsの.xsファイルと.x *ファイルは何ですか?

ldscriptsの.xsファイルと.x *ファイルは何ですか?

これらのファイルは何ですか?

/lib/x86_64-linux-gnu/ldscripts/elf32_x86_64.xs
/lib/x86_64-linux-gnu/ldscripts/elf_x86_64.xs
/lib/x86_64-linux-gnu/ldscripts/elf_i386.xs
/lib/x86_64-linux-gnu/ldscripts/elf_iamcu.xs
/usr/lib/x86_64-linux-gnu/ldscripts/elf32_x86_64.xs
/usr/lib/x86_64-linux-gnu/ldscripts/elf_x86_64.xs
/usr/lib/x86_64-linux-gnu/ldscripts/elf_i386.xs
/usr/lib/x86_64-linux-gnu/ldscripts/elf_iamcu.xs
/usr/lib/x86_64-linux-gnu/ldscripts/elf32_x86_64.xs
/usr/lib/x86_64-linux-gnu/ldscripts/elf_x86_64.xs
/usr/lib/x86_64-linux-gnu/ldscripts/elf_i386.xs
/usr/lib/x86_64-linux-gnu/ldscripts/elf_iamcu.xs

パッケージとして提供されますが、binutils-x86-64-linux-gnuシステムにどのように適していますか?それらは一種のシステム定義ファイルのようです。彼らの目的は何ですか?文書化されていますか?

ベストアンサー1

表示できる「shlib」スクリプトを生成するために使用されます。ここで以下のコメント

# Generate 5 or 6 script files from a master script template in
# ${srcdir}/scripttempl/${SCRIPT_NAME}.sh.  Which one of the 5 or 6
# script files is actually used depends on command line options given
# to ld.  (SCRIPT_NAME was set in the emulparams_file.)
#
# A .x script file is the default script.
# A .xr script is for linking without relocation (-r flag).
# A .xu script is like .xr, but *do* create constructors (-Ur flag).
# A .xn script is for linking with -n flag (mix text and data on same page).
# A .xbn script is for linking with -N flag (mix text and data on same page).
# A .xs script is for generating a shared library with the --shared
#   flag; it is only generated if $GENERATE_SHLIB_SCRIPT is set by the
#   emulation parameters.
# A .xc script is for linking with -z combreloc; it is only generated if
#   $GENERATE_COMBRELOC_SCRIPT is set by the emulation parameters or
#   $SCRIPT_NAME is "elf".
# A .xsc script is for linking with --shared -z combreloc; it is generated
#   if $GENERATE_COMBRELOC_SCRIPT is set by the emulation parameters or
#   $SCRIPT_NAME is "elf" and $GENERATE_SHLIB_SCRIPT is set by the emulation
#   parameters too.

私はそれらについてのより多くの情報を見ることができません。ただし、より多くの情報が見つかった場合は、この回答を自由に追加してください。

おすすめ記事