- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We wanted to use the LLVM LLD linker, but it complains about an incorrect section alignment emitted by ICPC. Here is my corresponding bug report to LLVM: https://bugs.llvm.org/show_bug.cgi?id=35854 . It turns out the bug apparently is within the Intel Compiler. Quoting my bugreport:
"
|
"
ICC Version:
icpc (ICC) 15.0.3 20150407
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please provide us a test case to investigate.
Regards,
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Testcase and Bug:
:~/cpp$ cat main.cpp
int main() { }
:~/cpp$ icpc -c main.cpp
:~/cpp$ llvm-readelf -relocations main.o
Relocation section '.rel.text' at offset 0x189 contains 1 entries:
Offset Info Type Sym. Value Symbol's Name
Error reading file: unaligned data
.
(notice the unaligned offset 0x189). People from LLVM have provided this technical comment:
"Essentially, all data structures in ELF should be aligned to their natural boundaries both in memory and file: Quote from http://refspecs.linuxbase.org/elf/elf.pdf p.16 "All data structures that the object file format defines follow the "natural" size and alignment guidelines for the relevant class. If necessary, data structures contain explicit padding to ensure 4-byte alignment for 4-byte objects, to force structure sizes to a multiple of 4, and so on. Data also have suitable alignment from the beginning of the file. Thus, for example, a structure containing an Elf32_Addr member will be aligned on a 4-byte boundary within the file."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
icpc (ICC) 15.0.3 20150407
You probably use too old compiler.
I tried 15.0.5 Build 20150805 and llvm-readelf built from trunk 6.0 and got the following output:
$ cat main.cpp
int main() {}
$ icpc -V -c main.cpp
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0 Build 20150805
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.
$ llvm-readelf -relocations main.o
Relocation section '.rela.text' at offset 0x284 contains 1 entries:
Offset Info Type Symbol's Value Symbol's Name + Addend
0000000000000017 0000000900000002 R_X86_64_PC32 0000000000000000 __intel_new_feature_proc_init - 4
Relocation section '.rela.eh_frame' at offset 0x29c contains 2 entries:
Offset Info Type Symbol's Value Symbol's Name + Addend
0000000000000011 0000000a00000001 R_X86_64_64 0000000000000000 __gxx_personality_v0 + 0
0000000000000028 0000000400000001 R_X86_64_64 0000000000000000 .text + 0
With the recent ICC 18.0 it also works fine.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page