> On Oct 20, 2014, at 11:00 AM, Roman Divacky <rdiva...@vlakno.cz> wrote:
> 
>>  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.
> 
> 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="-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,

-- 
Marcel Moolenaar
mar...@xcllnt.net

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to