![ldscripts 中的 .xs 和 .x* 文件是什么?](https://linux22.com/image/214529/ldscripts%20%E4%B8%AD%E7%9A%84%20.xs%20%E5%92%8C%20.x*%20%E6%96%87%E4%BB%B6%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F.png)
这些文件是什么
/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.
我没有看到更多关于他们的信息。但如果您能找到更多信息,请随意添加此答案。