This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: ld-related bug in LTTng


On Thu, May 01, 2014 at 10:52:23AM -0700, Martin Ünsal wrote:
[Re: http://gcc.gnu.org/ml/gcc-help/2014-04/msg00164.html
https://sourceware.org/ml/binutils/2012-06/msg00176.html and
https://sourceware.org/ml/binutils/2012-05/msg00232.html]

> So the real mystery is why the __start___tracepoints_ptrs symbol
> changed from local to global scope.

Right.

> Any ideas?

Is gcc emitting the reference to __start___tracepoints_ptrs as hidden?
(Look at an object with readelf -s to see)

> I am not a toolchain
> expert unfortunately. Do you think this could be an unintended side
> effect of your change, or should I be looking elsewhere?

It's not impossible that there was an unintended side effect, but I
did test current mainline, 2.24 and 2.23 without seeing a problem.

cat > sym.s <<EOF
 .text
 .weak start_text
 .hidden start_text
 .dc.a start_text

 .data
 .weak start_data
 .hidden start_data
 .dc.a start_data

 .weak __start_mysec
 .hidden __start_mysec
 .dc.a __start_mysec
EOF
cat > mysec.s <<EOF
 .section mysec,"aw",@progbits
 .dc.a 0xc0ffee
EOF
cat > sym.t <<EOF
SECTIONS
{
  . = SIZEOF_HEADERS;
  .text :
  {
    start_text = .;
    *(.text)
  }
  .data :
  {
    start_data = ABSOLUTE(.);
    *(.data)
  }
}
EOF
as -o sym.o sym.s
as -o mysec.o mysec.s
ld -o sym.so -shared sym.o mysec.o -T sym.t

On x86_64 using 2.22 ld, readelf -sD sym.so gives me
    3   1: 00000000000000b0     0 NOTYPE  LOCAL  DEFAULT   1 start_text
    4   2: 00000000000002c8     0 NOTYPE  LOCAL  DEFAULT ABS __start_mysec
    2   2: 00000000000001c8     0 NOTYPE  LOCAL  DEFAULT ABS start_data

For 2.23 and later
    3   1: 00000000000000b0     0 NOTYPE  LOCAL  DEFAULT   1 start_text
    4   2: 00000000000002c8     0 NOTYPE  LOCAL  DEFAULT   8 __start_mysec
    2   2: 00000000000001c8     0 NOTYPE  LOCAL  DEFAULT ABS start_data

As you can see, all the symbols are local..

-- 
Alan Modra
Australia Development Lab, IBM


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