DT_USED ELF 文件的 .dynamic 部分中的条目
DT_USED entry in .dynamic section of ELF file
我对 .dynamic 部分中的 DT_USED 条目感到好奇。但是,我只能找到两个描述此条目的代码示例。
1.
#define DT_USED 0x7ffffffe /* ignored - same as needed */
在https://github.com/switchbrew/switch-tools/blob/master/src/elf_common.h
2.
case DT_USED:
case DT_INIT_ARRAY:
case DT_FINI_ARRAY:
if (do_dynamic)
{
if (entry->d_tag == DT_USED
&& VALID_DYNAMIC_NAME (entry->d_un.d_val))
{
char *name = GET_DYNAMIC_NAME (entry->d_un.d_val);
if (*name)
{
printf (_("Not needed object: [%s]\n"), name);
break;
}
}
print_vma (entry->d_un.d_val, PREFIX_HEX);
putchar ('\n');
}
break;
在http://web.mit.edu/freebsd/head/contrib/binutils/binutils/readelf.c
我想知道,"Not needed object"是什么意思?这是否意味着不需要此处列出的文件名?
一般来说,在查看 Solaris 动态链接器功能时,可以在 public Illumos 资源(曾经派生自 OpenSolaris)中找到更多信息。在这种情况下,似乎 DT_USED
总是被视为 DT_NEEDED
,因此它们本质上是同一件事。其中一个头文件 usr/src/uts/common/sys/link.h
也包含以下内容:
/*
* DT_* entries between DT_HIPROC and DT_LOPROC are reserved for processor
* specific semantics.
*
* DT_* encoding rules apply to all tag values larger than DT_LOPROC.
*/
#define DT_LOPROC 0x70000000 /* processor specific range */
#define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */
#define DT_USED 0x7ffffffe /* ignored - same as needed */
#define DT_FILTER 0x7fffffff /* shared library filter name */
#define DT_HIPROC 0x7fffffff
这里可能有一些计划,但似乎没有实现(或者曾经是但现在不再是)。
我对 .dynamic 部分中的 DT_USED 条目感到好奇。但是,我只能找到两个描述此条目的代码示例。
1.
#define DT_USED 0x7ffffffe /* ignored - same as needed */
在https://github.com/switchbrew/switch-tools/blob/master/src/elf_common.h
2.
case DT_USED:
case DT_INIT_ARRAY:
case DT_FINI_ARRAY:
if (do_dynamic)
{
if (entry->d_tag == DT_USED
&& VALID_DYNAMIC_NAME (entry->d_un.d_val))
{
char *name = GET_DYNAMIC_NAME (entry->d_un.d_val);
if (*name)
{
printf (_("Not needed object: [%s]\n"), name);
break;
}
}
print_vma (entry->d_un.d_val, PREFIX_HEX);
putchar ('\n');
}
break;
在http://web.mit.edu/freebsd/head/contrib/binutils/binutils/readelf.c
我想知道,"Not needed object"是什么意思?这是否意味着不需要此处列出的文件名?
一般来说,在查看 Solaris 动态链接器功能时,可以在 public Illumos 资源(曾经派生自 OpenSolaris)中找到更多信息。在这种情况下,似乎 DT_USED
总是被视为 DT_NEEDED
,因此它们本质上是同一件事。其中一个头文件 usr/src/uts/common/sys/link.h
也包含以下内容:
/*
* DT_* entries between DT_HIPROC and DT_LOPROC are reserved for processor
* specific semantics.
*
* DT_* encoding rules apply to all tag values larger than DT_LOPROC.
*/
#define DT_LOPROC 0x70000000 /* processor specific range */
#define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */
#define DT_USED 0x7ffffffe /* ignored - same as needed */
#define DT_FILTER 0x7fffffff /* shared library filter name */
#define DT_HIPROC 0x7fffffff
这里可能有一些计划,但似乎没有实现(或者曾经是但现在不再是)。