bug-mes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ELF header conflict


From: Jan Nieuwenhuizen
Subject: Re: ELF header conflict
Date: Wed, 21 Apr 2021 08:40:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

W. J. van der Laan writes:

Hi!,

> While trying to debug I bumped into what looks like "mescc -g"
> generates invalid or at least incomplete ELF headers due to
> incompatibility with mescc-tools:
>
> - The e_shnum (number of sections) in lib/linux/*/elf??-header.hex2
> does not match what is generated by bloodelf, bloodelf generates 5
> section headers (NULL, .text, .shstr, .str, .sym) while e_shnum in the
> hardcoded header is 7 (NULL, .text, .data, .comment. .shstrtab,
> .symtab, .strtab)
>
> - due to the above e_shstrndx (index of shared string section) needs to be 2, 
> not 4
>
> - The size of .text does not cover libc, only _main and _start (libc
> normally ends up in .data, but this section is not present)

Hmm, the headers started off as a copy, but they may have diverged?
IWBN to use identical hearders.

> - "--64" is not passed to bloodelf on 64 bit RISC-V—this might be my
> fault, or simply one of the remaining 64-bit issues; the other points
> do not appear to be 64-bit specific, though

Ah, that could be a problem.

> I had to hack these locally before gdb showed backtraces (Linux itself
> doesn't care). Am I missing something, like, say, a completely
> different branch/version of mescc-tools? I am using the git version
> from https://github.com/oriansj/mescc-tools

That's not so nice, but it's a nice skill to have ;-)

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]