------- Comment #27 from geoffk at geoffk dot org 2007-11-03 07:21 ------- Subject: Re: [4.3 Regression] typeinfo name referenced in ... defined in discarded section
On 30/10/2007, at 9:03 PM, amodra at bigpond dot net dot au wrote: > ------- Comment #26 from amodra at bigpond dot net dot au > 2007-10-31 04:03 ------- > I believe the linker is correct to reject relocations against local > symbols in > discarded sections. The reason being that the linker allows > linkonce (and > comdat group) section contents to differ between two files, so that > for > example, two files may be compiled with different optimisations yet > still link > correctly. Since the contents may differ, the location of symbols > within the > section may also differ between files. Using the value of > "local_sym + offset" > in one file (in the discarded section) may point to an entirely > wrong location > in the other file (in the kept section). In this case, though, the contents of the linkonce section will never actually differ; and I believe in this case the offset is zero, so even if they did differ it would not matter. Perhaps a zero offset should be special-cased? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33871