[0.4.12][NTOSKRNL] Restore section layout for NTOSKRNL to fix BSOD regression CORE-14683

Although I fixed the DvDWriteNow-BSOD already in 0.4.12-RC-41-g1a9f0bc, I do switch to
the most advanced state of master for the sake of sync (different location of the ld script)
and because Thomas Faber thinks that it's a bit more
safe to just move "after .rsrc" instead of the proper "after .reloc".
A temporary tribute until ROSBE-154 will be fixed properly.

For now we use this just for NTOSKRNL, but not for drivers yet, see
MODULE TYPE sdk/cmake/gcc.cmake
As using also for drivers would immediately lead to BSODs like CORE-16183.
To allow installing DVDWritenow without BSOD,
we need the script at least for ntoskrnl!

The regression was introduced by SVN r55835 == git
6ebf8c2537

This patch (after .rsrc) was already committed into 0.4.13RC and 0.4.14RC and
0.4.15-dev-220-g
d28677795e
This commit is contained in:
Joachim Henze 2020-10-31 16:28:44 +01:00
parent 580c7720d0
commit 987a295dc7
4 changed files with 6 additions and 10 deletions

View File

@ -30,14 +30,15 @@ set_subsystem(ntoskrnl native)
if(MSVC)
set_image_base(ntoskrnl 0x00400000)
add_target_link_flags(ntoskrnl "/SECTION:.rsrc,!DP /SECTION:INIT,D") #Accessed from bugcheck code
add_target_link_flags(ntoskrnl "/SECTION:.rsrc,!DP") #Accessed from bugcheck code
add_target_link_flags(ntoskrnl "/SECTION:INIT,D")
else()
add_linker_script(ntoskrnl ntoskrnl_i386.lds)
if(GDB)
set_image_base(ntoskrnl 0x00800000)
else()
set_image_base(ntoskrnl 0x80800000)
endif()
add_linker_script(ntoskrnl ${REACTOS_SOURCE_DIR}/sdk/cmake/init-section.lds)
endif()
target_link_libraries(ntoskrnl cportlib csq ${PSEH_LIB} cmlib ntlsalib rtl ${ROSSYM_LIB} libcntpr wdmguid ioevent)

View File

@ -479,8 +479,5 @@ endmacro()
function(add_linker_script _target _linker_script_file)
get_filename_component(_file_full_path ${_linker_script_file} ABSOLUTE)
add_target_link_flags(${_target} "-Wl,-T,${_file_full_path}")
# Unfortunately LINK_DEPENDS is ignored in non-Makefile generators (for now...)
# See also http://www.cmake.org/pipermail/cmake/2010-May/037206.html
add_target_property(${_target} LINK_DEPENDS ${_file_full_path})
endfunction()

View File

@ -1,3 +1,4 @@
/* Make sure the INIT section is at the end of the module so we can reclaim the space */
SECTIONS
{
INIT BLOCK(__section_alignment__) :
@ -7,4 +8,4 @@ SECTIONS
__init_end__ = . ;
}
}
INSERT AFTER .reloc;
INSERT AFTER .rsrc;

View File

@ -614,9 +614,6 @@ function(add_linker_script _target _linker_script_file)
# add_custom_target("${_target}_${_file_name}" ALL DEPENDS ${_generated_file})
# add_dependencies(${_target} "${_target}_${_file_name}")
add_target_link_flags(${_target} "@${_generated_file}")
# Unfortunately LINK_DEPENDS is ignored in non-Makefile generators (for now...)
# See also http://www.cmake.org/pipermail/cmake/2010-May/037206.html
add_target_property(${_target} LINK_DEPENDS ${_generated_file})
add_target_property(${_target} LINK_DEPENDS ${_file_full_path})
endif()
endfunction()