tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Problem with NOTE commit


From: Michael Matz
Subject: Re: [Tinycc-devel] Problem with NOTE commit
Date: Fri, 25 Dec 2020 00:05:02 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hello,

On Thu, 24 Dec 2020, Herman ten Brugge via Tinycc-devel wrote:

The recent commit 'ELF: include SHT_NOTE sections everywhere' does not work for me on x86_64.

The problem is in /usr/lib64/crt1.o
If I do: readelf -a -W /usr/lib64/crt1.o | grep .gnu.build.attributes.hot
I get:
  [64] .gnu.build.attributes.hot NOTE            0000000000000000 0002e0 000028 00   G  0   0  4   [65] .rela.gnu.build.attributes.hot RELA 0000000000000000 001b38 000030 18  IG 90  64  8   [72] .gnu.build.attributes.hot NOTE            0000000000000000 000380 000028 00   G  0   0  4   [73] .rela.gnu.build.attributes.hot RELA 0000000000000000 001bf8 000030 18  IG 90  72  8   [80] .gnu.build.attributes.hot NOTE            0000000000000000 000420 000028 00   G  0   0  4   [81] .rela.gnu.build.attributes.hot RELA 0000000000000000 001cb8 000030 18  IG 90  80  8
   [   64]   .gnu.build.attributes.hot
   [   65]   .rela.gnu.build.attributes.hot
   [   72]   .gnu.build.attributes.hot
   [   73]   .rela.gnu.build.attributes.hot
   [   80]   .gnu.build.attributes.hot
   [   81]   .rela.gnu.build.attributes.hot

Huh, so multiple same-named sections in an .o file. Somewhat unusual, but the above are all in section groups, so a supported scenario (in the ELF sense, not by TCC). Can you send my your crt1.o file, please?

The tcc_load_object_file tries to merge the sections and then adjust the reloads. This does not work in this case because there are 3 section with the same name.

A hack would be to accept NOTE sections but only if they aren't in groups. Ugly, but, well... Of course, correctly implementing ELF group support would also be an option, but more work, or maybe other hacks are possible. I'll take a look if I can get such crt file.


Ciao,
Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]