⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 symver.html

📁 gcc手册
💻 HTML
字号:
<html lang="en">

<head>

<title>Using as</title>

<meta http-equiv="Content-Type" content="text/html">

<meta name="description" content="Using as">

<meta name="generator" content="makeinfo 4.3">

<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">

</head>

<body>

<div class="node">

<p>

Node:<a name="Symver">Symver</a>,

Next:<a rel="next" accesskey="n" href="Tag.html#Tag">Tag</a>,

Previous:<a rel="previous" accesskey="p" href="SubSection.html#SubSection">SubSection</a>,

Up:<a rel="up" accesskey="u" href="Pseudo-Ops.html#Pseudo%20Ops">Pseudo Ops</a>

<hr><br>

</div>



<h3 class="section"><code>.symver</code></h3>



   <p>Use the <code>.symver</code> directive to bind symbols to specific version nodes

within a source file.  This is only supported on ELF platforms, and is

typically used when assembling files to be linked into a shared library. 

There are cases where it may make sense to use this in objects to be bound

into an application itself so as to override a versioned symbol from a

shared library.



   <p>For ELF targets, the <code>.symver</code> directive can be used like this:

<pre class="smallexample">     .symver <var>name</var>, <var>name2@nodename</var>

     </pre>

   If the symbol <var>name</var> is defined within the file

being assembled, the <code>.symver</code> directive effectively creates a symbol

alias with the name <var>name2@nodename</var>, and in fact the main reason that we

just don't try and create a regular alias is that the <var>@</var> character isn't

permitted in symbol names.  The <var>name2</var> part of the name is the actual name

of the symbol by which it will be externally referenced.  The name <var>name</var>

itself is merely a name of convenience that is used so that it is possible to

have definitions for multiple versions of a function within a single source

file, and so that the compiler can unambiguously know which version of a

function is being mentioned.  The <var>nodename</var> portion of the alias should be

the name of a node specified in the version script supplied to the linker when

building a shared library.  If you are attempting to override a versioned

symbol from a shared library, then <var>nodename</var> should correspond to the

nodename of the symbol you are trying to override.



   <p>If the symbol <var>name</var> is not defined within the file being assembled, all

references to <var>name</var> will be changed to <var>name2@nodename</var>.  If no

reference to <var>name</var> is made, <var>name2@nodename</var> will be removed from the

symbol table.



   <p>Another usage of the <code>.symver</code> directive is:

<pre class="smallexample">     .symver <var>name</var>, <var>name2@@nodename</var>

     </pre>

   In this case, the symbol <var>name</var> must exist and be defined within

the file being assembled. It is similar to <var>name2@nodename</var>. The

difference is <var>name2@@nodename</var> will also be used to resolve

references to <var>name2</var> by the linker.



   <p>The third usage of the <code>.symver</code> directive is:

<pre class="smallexample">     .symver <var>name</var>, <var>name2@@@nodename</var>

     </pre>

   When <var>name</var> is not defined within the

file being assembled, it is treated as <var>name2@nodename</var>. When

<var>name</var> is defined within the file being assembled, the symbol

name, <var>name</var>, will be changed to <var>name2@@nodename</var>.



   </body></html>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -