diff options
author | Christopher Faylor <me+cygwin@cgf.cx> | 2004-07-03 16:07:51 +0000 |
---|---|---|
committer | Christopher Faylor <me+cygwin@cgf.cx> | 2004-07-03 16:07:51 +0000 |
commit | c87db184a7dd1e5542b807ae6d29db02b8ea0f5e (patch) | |
tree | 7b731760ae09b88e4dcdc976bc50a97c2d8478d5 /gas/doc | |
parent | 3b91255ea0fa465d5c79abc774e6c7aec13ca513 (diff) | |
download | gdb-c87db184a7dd1e5542b807ae6d29db02b8ea0f5e.zip gdb-c87db184a7dd1e5542b807ae6d29db02b8ea0f5e.tar.gz gdb-c87db184a7dd1e5542b807ae6d29db02b8ea0f5e.tar.bz2 |
2004-07-04 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
* bfd/cofflink.c (_bfd_coff_generic_relocate_section): Resolve PE weak
externals properly.
* src/gas/config/obj-coff.c (obj_coff_weak): New .weak syntax for PE weak
externals.
* binutils/doc/binutils.texi (nm): Clarify weak symbol description.
* gas/config/tc-i386.c (tc_gen_reloc): Use addend for weak symbols in TE_PE.
* gas/doc/as.texinfo (Weak): Document PE weak symbols.
* ld/ld.texinfo (WIN32): Document PE weak symbols.
Diffstat (limited to 'gas/doc')
-rw-r--r-- | gas/doc/as.texinfo | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index 056fa6d..29605b3 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -3400,8 +3400,8 @@ respectively, with @code{.val} and @code{.type}. @cindex auxiliary attributes, COFF symbols The @command{@value{AS}} directives @code{.dim}, @code{.line}, @code{.scl}, -@code{.size}, and @code{.tag} can generate auxiliary symbol table -information for COFF. +@code{.size}, @code{.tag}, and @code{.weak} can generate auxiliary symbol +table information for COFF. @end ifset @ifset SOM @@ -3823,9 +3823,9 @@ Some machine configurations provide additional directives. * Version:: @code{.version "@var{string}"} * VTableEntry:: @code{.vtable_entry @var{table}, @var{offset}} * VTableInherit:: @code{.vtable_inherit @var{child}, @var{parent}} -* Weak:: @code{.weak @var{names}} @end ifset +* Weak:: @code{.weak @var{names}} * Word:: @code{.word @var{expressions}} * Deprecated:: Deprecated Directives @end menu @@ -5808,14 +5808,31 @@ parent whose addend is the value of the child symbol. As a special case the parent name of @code{0} is treated as refering the @code{*ABS*} section. @end ifset -@ifset ELF @node Weak @section @code{.weak @var{names}} @cindex @code{weak} directive This directive sets the weak attribute on the comma separated list of symbol @code{names}. If the symbols do not already exist, they will be created. -@end ifset + +Weak symbols are supported in COFF as a GNU extension. This directive +sets the weak attribute on the comma separated list of symbol +@code{names}. If the symbols do not already exist, they will be created. + +@smallexample +@code{.weak @var{name} [ < = | == > @var{alternate}] [, ...]} +@end smallexample + +On the PE target, weak aliases are supported natively. Weak aliases +(usually called "weak externals" in PE) are created when an alternate +name is specified. When a weak symbol is linked and the symbol is not +defined, the weak symbol becomes an alias for the alternate symbol. If +one equal sign is used, the linker searches for defined symbols within +other objects and libraries. This is the usual mode, historically +called "lazy externals." Otherwise, when two equal signs are used, +the linker searches for defined symbols only within other objects. + +Non-alias weak symbols are supported on PE as a GNU extension. @node Word @section @code{.word @var{expressions}} |