IRC logs for #openrisc Friday, 2013-01-25

_franck_jeremybennett: I managed to link or1k gdb with or1ksim, now I'm here:
_franck_or1ksim: invalid option "--sysroot=/opt/or1k-toolchain/or1k-elf/sys-root"01:50
--- Log closed Fri Jan 25 04:36:42 2013
--- Log opened Fri Jan 25 04:45:06 2013
-!- Irssi: #openrisc: Total of 24 nicks [0 ops, 0 halfops, 0 voices, 24 normal]04:45
-!- Irssi: Join to #openrisc was synced in 2 secs04:45
jeremybennett_franck_: interesting - looks like the sim interface expects to be able to pass across a --sysroot option (which Or1ksim does not recognize).10:41
jeremybennettI guess your wrapper for Or1ksim will have to just throw away that otion.10:41
_franck_yes, that's I saw. I was thinking add this as a dummy param in or1ksim but you're right, throwing it away in the wrapper sounds better10:43
stekernblueCmd: I took a look at elf32-or1k.c in the morning, but I don't really get what you want to know ;)14:15
blueCmdstekern: well, how does .got allocation work? how does it know how much got space to allocate? how do you compute the offset for each symbol?14:20
blueCmdwhen I begun reading the code to answer those questions, I encountered that if statement I pasted yesterday14:20
blueCmdand I couldn't for my life understand what sh_info and everything represented14:21
blueCmdI need to run, back later.14:21
stekernblueCmd: for the meaning of sh_info, look here:
stekernat page 1-1315:33
stekernthe got space is handled here:
stekernit get the got section out of the hash table, adds the new entry to the end and increases the got section by 415:53
stekernby "adding the new entry to the end" I really meant: it sets the current hashtable entry (h) got offset to the end of the got section15:55
_franck_jeremybennett: do you want saving me some time ? :)17:23
_franck_Executing on host: or32-elf-gcc ../../.././gdb-7.2/gdb/testsuite/gdb.base/advance.c  -mnewlib -mboard=or1ksim -g  -lm   -o /home/franck/ope....17:23
_franck_when testsuite compiling test program, where do -mnewlib and -mbord=or1ksim are coming ?17:24
_franck_running the or32 testsuite, I have those flags, running or1k testsuite, I don't17:25
_franck_and I still have a lot of errors runing the or1k testsuite with or1ksim17:25
jeremybennett_franck_: there are options in the or32-linux-sim.exp file for specifying c flags and link flags. Add them there.17:26
blueCmdstekern: ah, cool. thanks - I will read through it17:26
_franck_ok thanks, jeremybennett17:27
blueCmdstekern: you don't have an easy answer to when to use h->got.refcount and when to use the hash table?17:28
stekernthe got.refcount is used to mark the number of relocations that is using a symbol17:33
stekern1 symbol will only have one got entry17:34
stekern(at least in our case)17:34
stekernh->got is always referring to the got entry17:35
_franck_me == stupid !   :) I had #define OR32_SIM_DEBUG.... so when dejagnu was comparing output, all was wrong18:19
jeremybennettjuliusb: Are you around?19:22
blueCmdstekern: right, so why is h null sometimes?20:36
blueCmdfor symbols over sh_info (iirc)20:36
stekernblueCmd: all symbols doesn't have hashtable entries, for example local symbols, they might need to be in got anyway21:08
stekernthat's how I remember it at least, you better check up on it and correct me if I'm wrong ;)21:09
blueCmdstekern: ah makes sense21:09
blueCmdstekern: do you know how static linking effects got?21:10
blueCmdI'm trying to understand how the got references are initialized when linking staticly. I mean, if code has been generated to use GOT, and I choose to use static linking, the got is not needed but since the code is generated I figure the linker can't really change that fact21:13
blueCmdthe same for PLTs i suppose - but the final executable doesn't contain any relocations (which a non-static program would, which would be resolved on loading by libc)21:13
blueCmdso if the code is generated to use got, links staticly without any relocation records - how does libc fill in the got entries?21:15
blueCmd(hm, actually - on x64 gcc produces relocations on the static program as well, maybe it's not supported by or1k?)21:18
* blueCmd will read through ELF_Format.pdf - it might answer all this21:25
blueCmdaha, gotoff doesn't really need to be in the got - just relative to it. that's almost painfully obvious21:59
blueCmdso storing TLS stuff in .rodata for example would be possible if it's known link time22:00
blueCmdbut then again, it seems like my assumption that .got is mangled is pretty wrong - just storing the precomputed value in the got (effectivly resolving the otherwise pending relocations) will work as far as I can see22:41

Generated by 2.15.2 by Marius Gedminas - find it at!