Oops, you’re absolutely right. I’m not sure how that managed to slip through. 
I’ll post a fix shortly.

//Andreas

On 11/07/2016, 13:57, "gem5-dev on behalf of Gabor Dozsa" 
<[email protected] on behalf of [email protected]> wrote:

Hi Andreas,

The condition for the warn_if should be ‘text.size == 0’, shouldn’t be? I have 
seen quite a few such warnings about the the text.size recently using the 
internal branch ...

- Gabor

On Jul 11, 2016, at 11:03 AM, Andreas Sandberg <[email protected]> wrote:

> changeset 3210a0b99c88 in /z/repo/gem5
> details: http://repo.gem5.org/gem5?cmd=changeset;node=3210a0b99c88
> description:
> base: Convert ELF .text size check assertion to a warning
>
> The ELF loader currently has an assertion that checks if the size of a
> loaded .text secion is non-zero. This is useful in the general case as
> an empty text section normally indicates that there is something
> strange with the ELF file. However, asserting isn't very useful. This
> changeset converts the assert into a warning that tells the user that
> something strange is happening.
>
> Change-Id: I313e17847b50a0eca00f6bd00a54c610d626c0f0
> Signed-off-by: Andreas Sandberg <[email protected]>
> Reviewed-by: Curtis Dunham <[email protected]>
>
> diffstat:
>
> src/base/loader/elf_object.cc |  4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diffs (14 lines):
>
> diff -r b921b96cbf74 -r 3210a0b99c88 src/base/loader/elf_object.cc
> --- a/src/base/loader/elf_object.ccMon Jul 11 10:39:22 2016 +0100
> +++ b/src/base/loader/elf_object.ccMon Jul 11 10:39:30 2016 +0100
> @@ -383,7 +383,9 @@
>     }
>
>     // should have found at least one loadable segment
> -    assert(text.size != 0);
> +    warn_if(text.size != 0,
> +            "Empty .text segment in '%s'. ELF file corrupted?\n",
> +            filename);
>
>     DPRINTFR(Loader, "text: 0x%x %d\ndata: 0x%x %d\nbss: 0x%x %d\n",
>              text.baseAddr, text.size, data.baseAddr, data.size,
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev


IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to