From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: Michael.Nonweiler@arm.com Cc: bfd@cygnus.com, Sumit.Sahai@arm.com Subject: Re: ELF STT_SECTION symbol for .comment section Date: Thu, 11 Feb 1999 09:17:00 -0000 Message-id: <199902111717.MAA00310@subrogation.cygnus.com> References: <199902111212.MAA02147@bsun1.arm.com> X-SW-Source: 1999/msg00021.html Date: Thu, 11 Feb 1999 12:11:04 +0000 From: Michael Nonweiler The problem is caused by the function elf_map_symbols in bfd/elf.c generating an unnamed section symbol for the ".comment" section of an object file. This upsets my linker because it expects to map all symbols to image locations, and the ".comment" section of the object file is not part of the image. That expectation seems like a bug. In fact, since some types of debugging informations have references between debugging sections, which require symbols in the debugging sections, I don't see how this can work in practice. FYI: The ".comment" section normally contains the version string of the Enabling debugging for elf.c shows that this is the _only_ section symbol added by "elf_map_symbols". Section symbols for the other sections are generated by gcc. I don't know what these symbols are for, but I feel sure it can't be necessary to have one for the ".comment" section of the object. I agree. However, a section symbol may be required for any section which can have relocations. Relocations can appear in sections which are not loaded, such as debugging sections. The behaviour of the GNU ELF linker was loosely based on the behaviour of the Solaris linker. That linker does add a section symbol for the .comment section. So since I think we agree that there is a bug in the linker you are using, and since adding a section symbol follows the lead of at least one other ELF linker, I'm not too inclined to change the GNU linker behaviour. Ian