Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jbernard@debian.org (Jon Bernard)
Subject: [ltt-dev] [UST] Text relocations in 0.12
Date: Sat, 16 Apr 2011 19:24:33 -0400	[thread overview]
Message-ID: <20110416232432.GA22197@starquasia> (raw)

As I prepared the 0.12 release for Debian, I noticed that libust.so was
not PIC:

    $ readelf -d libust/.libs/libust.so.0.0.0 | grep TEXTREL
    0x0000000000000016 (TEXTREL)            0x0

Since all of the objects in libust are built with -fPIC, I thought
perhaps there was some assembly added between 0.11 and 0.12 that
contained text relocations. I bisected the two tags down to the
offending commit:

    eb5d20c68aaf73661ffc02ba8fea3683c0358702

Within that commit, it seems to be a problem in include/ust/marker.h
with these lines:

@@ -129,7 +124,12 @@ struct marker {
[...]
+                       /*".section __markers_ptrs\n\t"*/ \
+                       ".section __markers_ptrs,\"a\", at progbits\n\t"                           \

If I make the __markers_ptrs section writable, with:

                        ".section __markers_ptrs,\"aw\"\n\t

TEXTREL goes away and everything seems okay, tests pass. Is this
a correct solution? I don't understand why the section must be writable
to avoid relocations, can anyone explain?

Cheers

Jon




             reply	other threads:[~2011-04-16 23:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-16 23:24 Jon Bernard [this message]
2011-04-19  1:18 ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110416232432.GA22197@starquasia \
    --to=jbernard@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox