Hi Peter,
I just noticed that the continue this patch deletes was not tested. Trying to add a test I realized that we never put a VER_NDX_LOCAL symbol in the dynamic symbol table. Is there a reason why a linker ever would?
Differential D41247
Handle a VersymIndex of 0 as an error • rafael on Dec 14 2017, 10:04 AM. Authored by
Details
Hi Peter, I just noticed that the continue this patch deletes was not tested. Trying to add a test I realized that we never put a VER_NDX_LOCAL symbol in the dynamic symbol table. Is there a reason why a linker ever would?
Diff Detail Event TimelineComment Actions It looks like bfd and gold use this value for undefined symbols in DSOs that do not have version definitions. But at this point we are only dealing with defined symbols. The Solaris documentation: https://docs.oracle.com/cd/E19120-01/open.solaris/819-0690/chapter6-31/index.html Aside from that, I can't see a reason why a linker would deliberately use VER_NDX_LOCAL for a dynamic symbol. It could appear there because of a bug similar to the case where an STB_LOCAL appears in the dynsym. But unless we encounter an example of such a DSO I think we'd be fine erroring out on it. This LGTM with one nit.
|
Can we set VersymIndex to VER_NDX_GLOBAL instead of 0 at the start of the loop body? Then I think this can just be if (VersymIndex != VER_NDX_GLOBAL).