ThePassionate opened a new pull request, #17996:
URL: https://github.com/apache/nuttx/pull/17996

   ## Crypto: Rename SipHash Symbol to Avoid Naming Conflict
   
   ### Summary
   
   This PR renames SipHash-related symbols to avoid conflicts with 
compiler-generated section names. The Tricore-gcc compiler generates function 
sections with an '_end' suffix, which conflicts with the `siphash_end` symbol. 
This change improves compatibility with various compiler toolchains.
   
   ### Changes
   
   #### Files Modified
   
   1. **crypto/siphash.c**
      - Rename function `siphash_end()` to `siphash_finish()`
      - Update all function calls to use the new name
   
   2. **include/crypto/siphash.h**
      - Update function declaration from `siphash_end()` to `siphash_finish()`
      - Update SipHash24 macro from `SipHash24_End` to `SipHash24_Finish`
      - Update SipHash48 macro from `SipHash48_End` to `SipHash48_Finish`
   
   ### Technical Details
   
   **Issue:**
   - Tricore-gcc compiler generates function sections with '_end' suffix (e.g., 
`function_end`)
   - The `siphash_end` symbol name conflicts with compiler-generated section 
names
   - This causes linker or naming conflicts when using Tricore-gcc toolchain
   
   **Solution:**
   - Rename `siphash_end` to `siphash_finish` throughout the codebase
   - Rename corresponding macros to maintain consistency
   - Avoids conflicts while preserving API functionality
   
   **Benefits:**
   - Improves compatibility with Tricore-gcc and similar toolchains
   - Eliminates naming conflicts
   - Maintains consistent naming convention across SipHash API
   
   ### Impact
   
   - **Compatibility**: Improves support for Tricore-gcc compiler
   - **Naming**: Updates symbol names to avoid conflicts
   - **API**: Existing code using these functions will need to be updated with 
new symbol names
   - **Testing**: No functional changes; SipHash algorithm behavior remains 
identical
   
   ### Testing
   
   SipHash functionality remains unchanged; only symbol names are updated.
   
   ---
   
   **Author**: makejian <[email protected]>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to