Project

General

Profile

Bug #6098

ld(1) should not require symbols which identify group sections be global

Added by Rich Lowe almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2015-08-04
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

It seems to me entirely valid that the symbol which identify SHF_GROUP sections via .sh_info should be local (or whatever else). The only specifications in the gABI regarding globalness relate to referencing the group, not the group identifying itself.

The check refusing STB_LOCAL should be removed.

Possibly additionally the check forbidding the signature symbol be defined should also be removed, I don't see why it must be defined, but I'm less certain of the implications of fixing that.

History

#1

Updated by Rich Lowe almost 5 years ago

https://gist.github.com/richlowe/0b305637a17fa54041ce is a diff of the conservative fix for the issue as encountered by Igor.

#2

Updated by Rich Lowe almost 5 years ago

In fact, the gABI specifically states, here: http://www.sco.com/developers/gabi/2003-12-17/ch4.sheader.html#section_groups

"The referenced signature symbol is not restricted. Its containing symbol table section need not be a member of the group, for example."

Which could easily be read to suggest that the SHN_UNDEF check is also invalid, as suspected (you'll note that the checks implemented closely, but not precisely, reflect those described for references from outside the group for comdat groups).

I think all the checks for signature symbol validity are bogus, beyond the basic checks already performed (that the sh_link/sh_info fields actually are valid in a more general sense)

#3

Updated by Electric Monk almost 5 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 50 to 100

git commit 359db861fd14071f8a25831efe3bf3790980d071

commit  359db861fd14071f8a25831efe3bf3790980d071
Author: Richard Lowe <richlowe@richlowe.net>
Date:   2015-08-17T15:54:32.000Z

    6098 ld(1) should not require symbols which identify group sections be global
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Reviewed by: Gordon Ross <gwr@nexenta.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF