This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug uprobes/12851] Wrong section group usage in <sys/sdt.h>


http://sourceware.org/bugzilla/show_bug.cgi?id=12851

--- Comment #5 from Mark Wielaard <mjw at redhat dot com> 2011-06-08 15:15:34 UTC ---
(In reply to comment #4)
> No. Linker is correct.  YOU CAN'T HAVE LOCAL REFERENCES OUTSIDE OF
> A COMDAT GROUP.

I assume you are referring to gabi:

"To facilitate removing a group without leaving dangling references and with
only minimal processing of the symbol table, the following rules must be
followed:

    A symbol table entry with STB_GLOBAL or STB_WEAK binding that is defined
relative to one of a group's sections, and that is contained in a symbol table
section that is not part of the group, must be converted to an undefined symbol
(its section index must be changed to SHN_UNDEF) if the group members are
discarded. References to this symbol table entry from outside the group are
allowed."


> Non comdat member section, .note.stapsdt, has a local
> reference of _.stapsdt.base, which is defined in a comdat
> section. Did you mean to put .note.stapsdt section in the same
> comdat group as .stapsdt.base section?

No. It is deliberately in its own COMDAT group to make sure there is only one
.stapsdt.base section in the final object.

> > I am curious why we haven't seen this before.
> > Against which binutils/linker is this?
> 
> You need glibc with systemtap support, like Fedora 15, to
> see the problem:
> [...]
> [hjl@gnu-6 tmp]$ gcc gcsec-1.c -ffunction-sections -fdata-sections
> -Wl,--gc-sections -static -B/usr/bin/

Thanks for that testcase. So it is --gc-sections that is removing the
.stapsdt.base section because the linker thinks it is unused. hmmm. tricky.

When is --gc-sections used?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]