dlltool: Correct export name comparison in nfunc
A patch for dlltool correctly addresses an issue where explicit export names were being compared incorrectly, leading to wrong sorting and hints.
The nfunc function in dlltool was incorrectly comparing explicit export names. The patch rectifies this by ensuring the right-hand side’s explicit name (its_name) is used for comparison, which fixes incorrect sorting and the assignment of wrong hints when the second export had an explicit name. The change has been acknowledged and approved.
- proposer
Submitted a patch to fix an issue in `dlltool`'s `nfunc` where explicit export names were compared incorrectly.
“nfunc compares the export table names of two exports, using its_name when an export has one. The right-hand its_name was assigned to the left-hand name, so exports were sorted by the wrong name and given the wrong hints when the second export had an explicit name.”
- maintainer
Approved the patch, confirming that the fix is correct.
“Okay.”
Technical Tradeoffs
- Correctness of sorting and metadata assignment in `dlltool`.
- Ensures predictable behavior when dealing with explicitly named exports.
In Details
This patch for binutils' dlltool addresses a bug in the nfunc function's sorting logic. Specifically, when comparing exports that have explicit names, the function was using the wrong name for comparison, leading to incorrect ordering and associated metadata. The fix ensures that the correct explicit name is used, resolving the sorting issue.
- dlltool
- A tool in the binutils package that creates DLL import libraries for Windows systems.
- nfunc
- Likely a specific function or routine within dlltool responsible for handling named functions or exports.
- its_name
- A field or variable likely representing the explicit name of an export in the context of dlltool.