Talk:Weak symbol

Latest comment: 1 year ago by Beyourselfeveryoneelseistaken in topic Citation for statement regarding multiple strong symbols

external reference error edit

Please remove the external reference. The link is not correct. It is now pointing to gcc.gnu.org/ml/gcc/1999-02n/msg01219.htm which does not exists and the 'fixed' link http://gcc.gnu.org/ml/gcc/1999-02/msg01219.html is pointing to a totally unrelated message on the messagelist. —Preceding unsigned comment added by 82.146.125.132 (talk) 14:01, 15 July 2010 (UTC)Reply

Currently, all references are correct. --Gms (talk) 00:13, 30 May 2013 (UTC)Reply

Example code edit

The example section could be improved by stating the code's expected output and explaining how it behaves differently or fails to compile if the weak attribute is omitted. -- JoshRosen (talk) 06:25, 9 May 2012 (UTC)Reply

The current article version now includes an extended example section, expected output and non-weak results. --Gms (talk) 00:11, 30 May 2013 (UTC)Reply
I think on my linux machine, if "void __attribute__((weak)) user_hook(void);" is removed, main2 won't compile with following error messages:"multiple definition of `user_hook'", which differs the outcome described by the page. --Jimleeking 12:15, 26 Mar 2017 (UTC)

Not Specific to ELF - Decades Older edit

This article is written as though it is part of a Gnu tool chain manual. The weak symbol (weak external) concept was first implemented over two and a half decades before ELF ever existed, and quite possibly over three decades. Weak external existed in IBM mainframe assemblers and were implemented by the link editor in IBM's OS MVT, to my personal knowledge, in 1972. As MVT dates from 1967, it could well mean that the concept existed 3 decades before ELF's specification in 1997. IBM may well have taken the concept from an earlier system.

-- David Woolley (talk) 23:50, 21 January 2015 (UTC)Reply

Citation for statement regarding multiple strong symbols edit

The fourth sentence in the introductory paragraph says:

"In contrast, in the presence of two strong symbols by the same name, the linker resolves the symbol in favor of the first one found."

Could someone please provide a citation for this - which linker implementation is this referring to? I'm new to this topic and most resources only mention the "multiple strong symbols are not allowed" rule of Unix-based linkers. Beyourselfeveryoneelseistaken (talk) 02:30, 24 November 2022 (UTC)Reply