Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Oct 2014 11:39:07 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Roman Divacky <rdivacky@vlakno.cz>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar <marcel@FreeBSD.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r273334 - in head/sys: boot/common kern sys
Message-ID:  <B9FC0A7A-07E7-480E-B331-46D9EAE3476D@xcllnt.net>
In-Reply-To: <20141020180002.GA85946@vlakno.cz>
References:  <201410201704.s9KH44wX079917@svn.freebsd.org> <20141020180002.GA85946@vlakno.cz>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Oct 20, 2014, at 11:00 AM, Roman Divacky <rdivacky@vlakno.cz> =
wrote:
>=20
>>  Note that LLVM appends the priority of the constructors to the name =
of
>>  the .ctors section. Not so when compiling with GCC. The code =
currently
>>  works for GCC and not for LLVM.
>=20
> Uhm? LLVM here creates ".ctors" section, nothing is appended. Can you =
be more
> specific on what you're seing?

Go to a module build directory (I picked uart) and build on amd64:

% make DEBUG_FLAGS=3D"-ftest-coverage -fprofile-arcs"

Check with objdump:

% objdump -x /usr/obj/usr/src/sys/modules/uart/uart.ko | grep ctors
 16 .ctors.65535  00000080  0000000000000000  0000000000000000  00020320 =
 2**3
0000000000000000 l    d  .ctors.65535	0000000000000000 .ctors.65535
RELOCATION RECORDS FOR [.ctors.65535]:

As you can see, the section is not called .ctors, but it's called
.ctors.$((65536-priority)).

The priority suffix is removed as part of linking, but on amd64,
kernel modules are relocatables...

FYI,

--=20
Marcel Moolenaar
marcel@xcllnt.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B9FC0A7A-07E7-480E-B331-46D9EAE3476D>