]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR 33821 use after free commit e6357caf7579
authorAlan Modra <amodra@gmail.com>
Thu, 22 Jan 2026 06:41:35 +0000 (17:11 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 22 Jan 2026 09:06:49 +0000 (19:36 +1030)
commitd75f191dc631664e4f18c6938f0cb72f1f50c34a
treefc4b5454e9c3c1965dd37a1d318d9f37af980047
parent5fab123e2090cda6862f400a5e001a9a051a765f
PR 33821 use after free commit e6357caf7579

reset_resolved_wilds didn't clear out matching_sections in output
sections with constraint -1.  Fix that and tidy call sites of
obstack_init and obstack_free for matching_obstack so that the obstack
is allocated later and freed completely.  Also tidy ptroot.

PR 33821
* ldlang.c (the_root): Delete, replacing with..
(ptroot): ..this, no longer a pointer.  Update all uses.
(lang_for_each_statement_worker): Add "constrained" param.
Ignore os.constraint if false.
(reset_resolved_wilds): Use lang_for_each_statement_worker.
Move obstack_init..
(lang_init): ..and this obstack_init of matching_obstack..
(resolve_wilds): ..to here.
* ldlang.h (lang_for_each_statement_worker): Update declaration.
(lang_for_each_statement): Update.
* emultempl/xtensaelf.em: Update lang_for_each_statement_worker
calls throughout.
ld/emultempl/xtensaelf.em
ld/ldlang.c
ld/ldlang.h