bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/18935] Gold assert fail when moving dot in NOLOAD section.


From: ccoutant at gmail dot com
Subject: [Bug gold/18935] Gold assert fail when moving dot in NOLOAD section.
Date: Mon, 14 Sep 2015 23:13:05 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=18935

--- Comment #2 from Cary Coutant <ccoutant at gmail dot com> ---
> Seems a bit unclear what the expected behavior is.
>
>  .init_stack (NOLOAD) :
>  {
>    . = . + 0x200;
>  } :ph_load
> With this ld.bfd creates a NOBITS SHF_ALLOC section(just like .bss).
>
> When a new non-SHF_ALLOC output section is created the address is set to 0.
> Layout::make_output_section_for_script(), which is the function that creates
> the init_stack section, only tries to create sections with SHT_PROGBITS
> section. This is why the assert fails when
> Output_section_definition::set_section_addresses() tries to assign an address
> to the section.

This script looks like it's trying to create an unloadable section,
then allocate it to a loadable segment. If all the script is trying to
do is create a loadable NOBITS section, the NOLOAD attribute shouldn't
be necessary (or allowed). The fact that it contains nothing but
uninitialized space should be sufficient. I don't think gold does the
right thing in that case, but that ought to be the bug, not that
NOLOAD should make it work.

What does Gnu ld do if you omit NOLOAD? Do you have any history that
explains why NOLOAD was added to the script?

-cary

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

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