bugTiny C Compiler - Bugs: bug #66926, `tcc -run` assumes the dynamic...

 
 

bug #66926: `tcc -run` assumes the dynamic library is located in the current directory on Windows

Submitter:  waterlens <yangrq>
Submitted:  Tue 18 Mar 2025 03:41:22 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 18 Mar 2025 03:41:22 PM UTC, original submission:  

On Windows, when passing a DLL path to TCC, TCC uses the following sequence to record the dynamic library information:

1. `pe_load_file(...)`
2. `pe_load_dll(...)`
3. `tcc_add_dllref(..., tcc_basename(filename), ...)`

At some point, TCC invokes `LoadLibraryA` to load `dllref->name`. However, `dllref->name` is just the basename of the full path (`tcc_basename(filename)`). As a result, TCC can only load the library correctly if it happens to have a copy in the current directory, which is not the intended behavior.

waterlens <yangrq>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by yangrq (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.15-4cd8.
    Corresponding source code