Bug 1073187 - Another section specification was not stored in the generated object file.
Another section specification was not stored in the generated object file.
Status: RESOLVED INVALID
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development
Current
x86-64 SUSE Other
: P5 - None : Normal (vote)
: ---
Assigned To: Richard Biener
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-16 07:30 UTC by Markus Elfring
Modified: 2018-01-02 19:23 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Update example: Addition of section identifiers for two function definitions (684 bytes, patch)
2017-12-16 07:30 UTC, Markus Elfring
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Elfring 2017-12-16 07:30:34 UTC
Created attachment 753374 [details]
Update example: Addition of section identifiers for two function definitions

I tried out to specify extra sections for two functions as the attached patch example shows. I tried to clarify my understanding of desired software behaviour also by a request on the topic “Difficulties with section specifications for function definitions?”.
https://gcc.gnu.org/ml/gcc-help/2017-12/msg00034.html

I hope to get a bit more constructive feedback according to the software “GCC 7.2.1+r253932-2.3” for a test result like the following.


elfring@Sonne:~/Projekte/Linux/next-patched> my_cc=/usr/bin/gcc-7 && my_module=drivers/target/loopback/tcm_loop.o && make -j4 CC="${my_cc}" HOSTCC="${my_cc}" EXTRA_CFLAGS='-Og' allmodconfig "${my_module}" && size -A "${my_module}" | grep my_
…
my_update           510      0
my_test1            360      0


If I pass an other setting for the code optimisation like “Os” or “O3”, I observe that the section name “my_test1” is not displayed so far.
I would like to compare sizes for code sections (I am interested in) between software build variants. My approach seems to trigger further development considerations then when my extra names will be omitted somehow in special build configurations.

How can the situation be improved?
Comment 1 Richard Biener 2018-01-02 09:31:53 UTC
The functions you annotate are static and thus may be optimized out by the compiler for example via inlining.  You could say if a section is omitted
then it's size is zero (the function was inlined somewhere you don't account
separately).

You could "deal" with this by using -fno-inline to disable any inlining.  But
then for example IPA optimization might choose to duplicate such function,
specalizing it for a caller with constant arguments for example.  Then such
section would have two copies of the function.  -fno-ipa-cp-clone would avoid
that.

Note this isn't a bug thus bugzilla isn't really the correct forum to ask this kind of questions.
Comment 2 Markus Elfring 2018-01-02 19:23:01 UTC
(In reply to Richard Biener from comment #1)

Thanks for your information.


* I hoped somehow that my test section would not be optimised “away” (for a specific size comparison).

* The additional compilation parameters “-fno-…” might mean a target conflict for my use case then.