{"id":54,"date":"2007-09-20T23:52:18","date_gmt":"2007-09-21T07:52:18","guid":{"rendered":"http:\/\/www.airs.com\/blog\/archives\/54"},"modified":"2007-09-20T23:52:18","modified_gmt":"2007-09-21T07:52:18","slug":"linkers-part-17","status":"publish","type":"post","link":"https:\/\/www.airs.com\/blog\/archives\/54","title":{"rendered":"Linkers part 17"},"content":{"rendered":"<p>Warning Symbols<\/p>\n<p>The GNU linker supports a weird extension to ELF used to issue warnings when symbols are referenced at link time.  This was originally implemented for a.out using a special symbol type.  For ELF, I implemented it using a special section name.<\/p>\n<p>If you create a section named <code>.gnu.warning.SYMBOL<\/code>, then if and when the linker sees an undefined reference to <code>SYMBOL<\/code>, it will issue a warning.  The warning is triggered by seeing an undefined symbol with the right name in an object file.  Unlike the warning about an undefined symbol, it is not triggered by seeing a relocation entry.  The text of the warning is simply the contents of the <code>.gnu.warning.SYMBOL<\/code> section.<\/p>\n<p>The GNU C library uses this feature to warn about references to symbols like <code>gets<\/code> which are required by standards but are generally considered to be unsafe.  This is done by creating a section named <code>.gnu.warning.gets<\/code> in the same object file which defines <code>gets<\/code>.<\/p>\n<p>The GNU linker also supports another type of warning, triggered by sections named <code>.gnu.warning<\/code> (without the symbol name).  If an object file with a section of that name is included in the link, the linker will issue a warning.  Again, the text of the warning is simply the contents of the <code>.gnu.warning<\/code> section.  I don&#8217;t know if anybody actually uses this feature.<\/p>\n<p>Short entry today, more tomorrow.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning Symbols The GNU linker supports a weird extension to ELF used to issue warnings when symbols are referenced at link time. This was originally implemented for a.out using a special symbol type. For ELF, I implemented it using a special section name. If you create a section named .gnu.warning.SYMBOL, then if and when the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":0,"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.airs.com\/blog\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}