[Bug ld/30875] New: Output section type does not been applied to section forced output by `. = .` assignment

2023-09-19 Thread TheLastLin at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30875

Bug ID: 30875
   Summary: Output section type does not been applied to section
forced output by `. = .` assignment
   Product: binutils
   Version: 2.38
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: TheLastLin at hotmail dot com
  Target Milestone: ---

Created attachment 15118
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15118&action=edit
Workaround patch, set flags by sectype at exp_init_os and
map_input_to_output_sections:case lang_assignment_statement_enum

Sometimes we may want to keep some empty section from discarding with ` . = .
`. But it seems that such empty section don't apply specific output section
type.

Example linker script:

SECTIONS
{
foo (READONLY) :
{
 *(bar)
 . = . ;
}
}

Expected(when bar doesn't exist in input):
section foo with no SHF_WRITE flags.

Actually(when bar doesn't exist in input):
section foo with SHF_WRITE flag.

A workaround is also

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


[Bug ld/30875] Output section type does not been applied to section forced output by `. = .` assignment

2023-09-19 Thread TheLastLin at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30875

Hsinyuan Xavier  changed:

   What|Removed |Added

 CC||TheLastLin at hotmail dot com

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