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

--- Comment #2 from Nick Clifton <nickc at redhat dot com> ---
Hi H.J.

  Personally I think that this is a case where the test itself should be
changed.  Or at least made conditional upon --rosegment not being in effect. 
Or changed so that it does not complain about .note.build-id and
.note.gnu.property sections being present in the read-execute segment.

> Since -z separate-code is passed to linker, there shouldn't be mixed rodata
> and text section in a page.

True - but - the rodata that is there are notes rather than program data, and
whilst it is still theoretically possible that these notes will mimic valid
instructions, possibly even exploitable instruction sequences, the chances of
this happening are very low.

The reason for the commit is that GDB has been relying upon the fact that the
linker would place the .note.build-id section in the first page of the
executable image.  This matters because when the kernel generates a core dump,
it includes the first page of the executable in the dump.  If the
.note.build-id section is present in this page then GDB can locate it and use
the information to track down the debug info file associated with the
executable whose failure triggered the core dump.

Of course it would be nice if there was another way for GDB to discover this
information, but I do not think that it is a practical solution.  It would
probably involve kernel changes, gdb changes, and maybe even linker changes. 
All of which would have to be coordinated and all of which would probably not
be backwards compatible.

What do you think - are you willing to accept a change to the test itself ?

Cheers
  Nick

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

Reply via email to