diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2020-05-04 15:53:10 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-06 04:42:39 -0400 |
commit | a95e7fe02efd2fdeec91ba46de64bc78c81381eb (patch) | |
tree | b39a517932cb887158d787eb0edba78bd04c24ac | |
parent | edec6a6c205378caf15d1d874d7e901ba76dd293 (diff) | |
download | haskell-a95e7fe02efd2fdeec91ba46de64bc78c81381eb.tar.gz |
ELF linker: increment curSymbol after filling in fields of current entry
The bug was introduced in a8b7cef4d45 which added a field to the
`symbols` array elements and then updated this code incorrectly:
- oc->symbols[curSymbol++] = nm;
+ oc->symbols[curSymbol++].name = nm;
+ oc->symbols[curSymbol].addr = symbol->addr;
-rw-r--r-- | rts/linker/Elf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c index c240a97d5e..3c0ace3a4b 100644 --- a/rts/linker/Elf.c +++ b/rts/linker/Elf.c @@ -944,8 +944,9 @@ ocGetNames_ELF ( ObjectCode* oc ) ) { goto fail; } - oc->symbols[curSymbol++].name = nm; + oc->symbols[curSymbol].name = nm; oc->symbols[curSymbol].addr = symbol->addr; + curSymbol++; } } else { /* Skip. */ |