Hello,
I am building an ELF image using aarch64-linux-gnu-ld from linaro:
GNU ld (crosstool-NG linaro-1.13.1-4.8-2014.02 - Linaro GCC 2014.02)
2.24.0.20131220
I am linking in the libstc++.a, which contains in particular a GOT
entry for __gthread_active_ptr that is of interest to me, pointing to
__pthread_key_create, used for detecting pthread support for
std::thread,
and while I get the relocations for the GOT itself in a .rela.dyn
section, and a nice pointer to it from the dynamic section (RELA), the
dynamic RELASZ entry contains zero:
Here is the comparison of the Dynamic section (note RELASZ) with the
following .rela.dyn relocations:
loader.elf: file format elf64-littleaarch64
loader.elf
architecture: aarch64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00000000400b0000
Program Header:
LOAD off 0x0000000000000000 vaddr 0x0000000040090000 paddr
0x0000000040090000 align 2**16
filesz 0x0000000000407084 memsz 0x00000000004aa504 flags rwx
TLS off 0x0000000000407080 vaddr 0x0000000040497080 paddr
0x0000000040497080 align 2**3
filesz 0x0000000000000004 memsz 0x0000000000000580 flags rw-
DYNAMIC off 0x0000000000001000 vaddr 0x0000000040091000 paddr
0x0000000040091000 align 2**3
filesz 0x0000000000000120 memsz 0x0000000000000120 flags rw-
EH_FRAME off 0x00000000003ce5fc vaddr 0x000000004045e5fc paddr
0x000000004045e5fc align 2**2
filesz 0x000000000000bae4 memsz 0x000000000000bae4 flags r--
NOTE off 0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000000000 align 2**3
filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
Dynamic Section:
NEEDED dummy-shlib.so
INIT_ARRAY 0x00000000404841b8
INIT_ARRAYSZ 0x0000000000000330
HASH 0x000000004044bd58
STRTAB 0x00000000403e3320
SYMTAB 0x00000000403a4110
STRSZ 0x0000000000068a33
SYMENT 0x0000000000000018
DEBUG 0x0000000000000000
RELA 0x00000000404780c0
RELASZ 0x0000000000000000
RELAENT 0x0000000000000018
private flags = 0:
...
10 .rela.dyn 00002058 00000000404780c0 00000000404780c0 003e80c0 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
...
and now the .rela.dyn.relocations from aarch64-linux-gnu-readelf -r
loader.elf :
Relocation section '.rela.dyn' at offset 0x3e80c0 contains 345 entries:
Offset Info Type Sym. Value Sym. Name + Addend
0000404832d0 002b00000401 R_AARCH64_GLOB_DA 00000000405339c8
_ZNSt8time_getIwSt19is + 0
0000404832d8 004400000401 R_AARCH64_GLOB_DA 000000004047e450
_ZTISt7codecvtIcc11__m + 0
0000404832e0 004b00000401 R_AARCH64_GLOB_DA 00000000405338c8
_ZGVNSt8numpunctIcE2id + 0
0000404832e8 005800000401 R_AARCH64_GLOB_DA 000000004047c460
_ZTISt8messagesIcE + 0
0000404832f0 006200000401 R_AARCH64_GLOB_DA 000000004047df40
_ZTVSt9strstream + 0
0000404832f8 007200000401 R_AARCH64_GLOB_DA 00000000402870dc
_ZNSt17bad_function_ca + 0
000040483300 008500000401 R_AARCH64_GLOB_DA 0000000040534e58
_ZGVN9__gnu_cxx16bitma + 0
000040483310 00c300000401 R_AARCH64_GLOB_DA 0000000040533a18
_ZNSt6locale2id11_S_re + 0
000040483318 00dd00000401 R_AARCH64_GLOB_DA 000000004047c160
_ZTISt5ctypeIwE + 0
000040483320 00ea00000401 R_AARCH64_GLOB_DA 0000000040534e18
_ZZN9__gnu_cxx9free_li + 0
000040483328 011700000401 R_AARCH64_GLOB_DA 0000000040533968
_ZGVNSt8time_getIwSt19 + 0
000040483330 013500000401 R_AARCH64_GLOB_DA 000000004047cfd8
_ZTISt7num_getIwSt19is + 0
000040483338 017300000401 R_AARCH64_GLOB_DA 000000004021d51c
__pthread_key_create + 0
...
^^...note the __pthread_key_create relocation I am interested in...
I would expect the RELASZ in the dynamic section to be 0x2058 instead of 0.
Any tips to what could be wrong?
Thank you,
Claudio Fontana
Hi,
I'm trying to build the native compiler to a arm a9 using this tutorial,https://wiki.linaro.org/WorkingGroups/ToolChain/Using/GCCNative.Ho…, I need to compile in a x86_64 platform ubuntu, like this --target=arm-unknown-eabi --build=i686-pc-linux-gnu --host=arm-unknown-eabi, but without success.There is any possible solution?
Thank you.Felipe Rocha da Rosa.
Hi all,
We are using Linaro 13.03 toolchain(gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux We are trying to execute a simple test code to check whether ARM assembly code executes on board or not. Execution is on Arndale Board. Every time We include assembly function, We get segmentation fault. Kindly check if I We are missing any arm related flags in makefile.
We have attached the 'helloworld' test code and makefile.
Regards,
Vishwa
===============================================================================
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===============================================================================
If your code is sensitive to the size of long long, can you use the predefine:
__SIZEOF_LONG_LONG__
If that doesn't work, then you can use:
gcc -dM -E - < /dev/null
to tell you what predefines a gcc compiler has (I would probably look for predefines more specific to what your code is sensitive to than look for a particular compiler).
I also wonder a little about your original problem statement since "%lld" should be a way to always print "long long" and if you have a matched set of compiler and library, then it should adjust both together. If you are using "%ld" instead, this works in situations where "long" is the same size as "long long" but may not work when these are different sizes.
--mev, Mike Vermeulen
Hi there!
On Linaro gcc 4.6, I am facing an issue due to "long long" integers
not being 64 bit as they are on other platforms I'm targeting,
which causes different issues, most importantly with printf format
strings. I am now circumventing these by using the C/C++ preprocessor
in order to choose the right format strings. In order to minimize the
necessity for users to manually configure things, I'm wondering if
there is a way to detect the Linaro gcc compiler through preprocessor
macros. Is this possible?
Thanks.
Best regards,
Isidor
Hi all,
We are using Linaro 13.03 toolchain(
gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux We are trying to
execute a simple test code to check whether ARM assembly code executes on
board or not. Execution is on Arndale Board. Every time We include assembly
function, We get segmentation fault. Kindly check if I We are missing any
arm related flags in makefile.
We have attached the ‘helloworld’ test code and makefile.
Regards,
Vishwa
Is that supposed to be possible? When I add --disable-multilib to the
configure options, the build fails on the install, because it hasn't built
any of src/gcc-linaro-4.8-2014.02/libgcc:
/bin/sh ../../../../src/gcc-linaro-4.8-2014.02/libgcc/../mkinstalldirs
/home/ubuntu/work483/build/sysroot/home/ubuntu/opt/cross-gcc-linaro/lib/gcc/arm-linux-gnueabi/4.8.3
/usr/bin/install -c -m 644 libgcc_eh.a
/home/ubuntu/work483/build/sysroot/home/ubuntu/opt/cross-gcc-linaro/lib/gcc/arm-linux-gnueabi/4.8.3/
/usr/bin/install: cannot stat `libgcc_eh.a': No such file or directory
make[3]: *** [install-shared] Error 1
make[3]: Leaving directory
`/home/ubuntu/work483/build/gcc/arm-linux-gnueabi/libgcc'
make[2]: *** [install-target-libgcc] Error 2
make[2]: Leaving directory `/home/ubuntu/work483/build/gcc'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/ubuntu/work483/build/gcc'
make: *** [stamp/gcc-install] Error 2
I don't want or need multilib, so I'd rather build the toolchain without
it, but before I try to make that happen, I wanted to make sure it's
supposed to be able to get built correctly that way.
Thanks,
Diane
== Progress ==
* IAS (TCWG-377)
- Long discussions about magic in inline asm
- Bottomline is: we're still validating anyway
* AArch64 (TCWG-387)
- Making it build with CMake, discarding some tests
- Similar changes to the test-suite
- All green except sphereflake
* Buildbots
- Investigating one failure on test-suite due
to register allocator changes
- Will continue this during or after Connect
* Background
- Connect preparations
- EuroLLVM 14 sync call, paper discussions
- Researching some kernel C/ASM syntax
- Studying __builtin_constant_p usage
- Patch reviews, etc.
* Time
- CARD-862 8/10
- Others 2/10
== Plan ==
* Connect
(slightly delayed)
== Progress ==
* 3 day week (annual leave Thursday and Friday)
* QEMU ARMv8 CRC instructions (4/10, TCWG-52)
* Slides for Connect (1/10)
* Further work on longjmp/setjmp Systemtap probes on ARM (1/10, TCWG-378)
== Issues ==
* None
== Plan ==
* Complete QEMU CRC instruction work
* Preparation for Connect
--
Will Newton
Toolchain Working Group, Linaro