[PATCH v3] elf: Set has_local_dynsyms for forced local symbol

H.J. Lu hjl.tools@gmail.com
Fri Jan 23 07:10:12 GMT 2026


On Wed, Jan 21, 2026 at 10:19 AM YunQiang Su <syq@gcc.gnu.org> wrote:
>
> Maciej W. Rozycki <macro@orcam.me.uk> 于2026年1月16日周五 08:04写道:
> >
> > On Thu, 15 Jan 2026, H.J. Lu wrote:
> >
> > > > Since there are dynamic symbols only if there are dynamic sections,
> > > > assert local dynamic symbol counts only if there are dynamic
> > > > sections.
> > > >
> > >
> > > Here is the v2 patch to set has_local_dynsyms to true in
> > > bfd_elf_link_record_dynamic_symbol for forced local symbol
> > > instead.
> >
> >  Thank you both for the report and the attempted fixes.  This v2 improves
> > test results for the `mips-linux' target:
> >
> >                 === ld Summary ===
> >
> > -# of expected passes           2076
> > +# of expected passes           2084
> >  # of unexpected failures       36
> >  # of expected failures         36
> >  # of known failures            1
> > -# of untested testcases                20
> > -# of unsupported tests         295
> > +# of untested testcases                2
> > +# of unsupported tests         306
> >
> > (as it turns out `run_ld_link_exec_tests' insists for some reason to only
> > run executables natively even if the board description file provides for
> > remote execution and the completion status change between UNTESTED and
> > UNSUPPORTED is easy to miss).  But also the new test fails for numerous
> > bare-metal targets:
> >
> > mips-elf  +FAIL: ld-mips-elf/pr33793
> > mips-rtems  +FAIL: ld-mips-elf/pr33793
> > mips64vr-elf  +FAIL: ld-mips-elf/pr33793
> > mips64vr4300-elf  +FAIL: ld-mips-elf/pr33793
> > mips64vr4300el-elf  +FAIL: ld-mips-elf/pr33793
> > mips64vrel-elf  +FAIL: ld-mips-elf/pr33793
> > mipsel-elf  +FAIL: ld-mips-elf/pr33793
> > mipsel-ps2-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32r2-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32r2el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32r3-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32r3el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32r5-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32r5el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32r6-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa32r6el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64r2-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64r2el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64r3-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64r3el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64r5-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64r5el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64r6-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64r6el-elf  +FAIL: ld-mips-elf/pr33793
> > mipsisa64sb1-elf  +FAIL: ld-mips-elf/pr33793
> > mipsr5900el-elf  +FAIL: ld-mips-elf/pr33793
> > tx39-elf  +FAIL: ld-mips-elf/pr33793
> >
> > e.g.:
> >
> > .../ld/ld-new: warning: cannot find entry symbol _start; defaulting to 00400018
> > succeeded with: <.../ld/ld-new: warning: cannot find entry symbol _start; defaulting to 00400018>, no expected output
> > FAIL: ld-mips-elf/pr33793
> >
> > I suggest specifying the entry point explicitly in the test case.
> >
>
> Yes.
> ```
> --- a/ld/testsuite/ld-mips-elf/pr33793.d
> +++ b/ld/testsuite/ld-mips-elf/pr33793.d
> @@ -1,4 +1,4 @@
> -#ld:
> +#ld: -e __start
>  #readelf: -D -s
>
>  Dynamic symbol information is not available for displaying symbols.
> ```
>
> can fix this problem.
>
> H.J., can you submit this patch?
>

Here is the v3 patch.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v3-0001-elf-Set-has_local_dynsyms-for-forced-local-symbol.patch
Type: application/x-patch
Size: 3438 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260123/72e9ea42/attachment.bin>


More information about the Binutils mailing list