MIPS: Fixes problem with .note.gnu.build-id section.
Sections can be allocated in a segment again when using objcopy on MIPS.
A bug in file offset tracking that occurred when the .note.gnu.build-id section followed .MIPS.abiflags and .reginfo sections has been fixed. This resolves an issue where objcopy would fail with the error message “section .note.gnu.build-id can’t be allocated in segment”.
In Details
This commit fixes a bug in bfd/elf.c's assign_file_positions_for_load_sections function, specifically impacting MIPS targets. The issue manifested after changes to test_build_id_debuglink and involved incorrect file offset tracking when a SHT_PROGBITS section (.note.gnu.build-id) followed SHT_NOBITS sections (.MIPS.abiflags and .reginfo).
For Context
This commit rectifies an issue in the Binary File Descriptor (BFD) library related to section handling for MIPS architectures. The problem arose when using objcopy, a tool for copying object files; specifically, a section related to build identification (.note.gnu.build-id) couldn't be correctly allocated due to its placement after other sections without content.