getsection: make use of Elf32_Ehdr and Elf32_Shdr on 32-bit systems #308

Merged
merged 1 commit into from Dec 2, 2016

Projects

None yet

2 participants

@jviotti
Contributor
jviotti commented Dec 2, 2016

Using the 64-bit counter parts causes the location of the embedded ELF
section for --updateinformation to be calculated incorrectly, and
eventually causing a segmentation fault.

Notice this commit relies on GCC specific defines (__i386__), and
defaults to 64-bit if 32-bit was not detected.

See: #307
Signed-off-by: Juan Cruz Viotti jviotti@openmailbox.org

@jviotti jviotti getsection: make use of Elf32_Ehdr and Elf32_Shdr on 32-bit systems
Using the 64-bit counter parts causes the location of the embedded ELF
section for `--updateinformation` to be calculated incorrectly, and
eventually causing a segmentation fault.

Notice this commit relies on GCC specific defines (`__i386__`), and
defaults to 64-bit if 32-bit was not detected.

See: probonopd#307
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
0db2028
@probonopd
Owner

Thank you! Should/could we also have an ifdef for ARM?

@jviotti
Contributor
jviotti commented Dec 2, 2016

I think so, but I have no idea what we could put there. Given there are both 32-bit and 64-bit ARM chips, I wonder if we could make use of __WORDSIZE from <limits.h>. If __WORDSIZE is 64, then we use Elf64_*, otherwise we use Elf32_*. What do you think?

@probonopd probonopd merged commit 0fdf491 into probonopd:appimagetool/master Dec 2, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@probonopd
Owner

Not sure. Let's tackle this when someone actually attempts an ARM build. @ericfont maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment