Page MenuHomeFreeBSD

elfcopy: include extension but replace . when converting from binary
ClosedPublic

Authored by emaste on Dec 9 2015, 5:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 2, 4:05 AM
Unknown Object (File)
Tue, Sep 30, 5:34 AM
Unknown Object (File)
Wed, Sep 24, 1:56 PM
Unknown Object (File)
Sep 14 2025, 1:42 AM
Unknown Object (File)
Sep 10 2025, 6:22 PM
Unknown Object (File)
Aug 29 2025, 12:53 AM
Unknown Object (File)
Aug 15 2025, 4:04 PM
Unknown Object (File)
Aug 5 2025, 9:32 PM
Subscribers
None

Details

Summary

The change in rS291958 was not consistent with GNU objcopy. The start/end/size symbols created for ELF objects converted from binary need to include the full filename including the extension, but with periods replaced with underscores.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste retitled this revision from to elfcopy: include extension but replace . when converting from binary.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added a reviewer: imp.

readelf -s shows the following for a fuzz.txt file converted to ELF:

Symbol table '.symtab' contains 5 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 SECTION LOCAL  DEFAULT    1 
     2: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT    1 _binary_fuzz_txt_start
     3: 00000000000011d0     0 NOTYPE  GLOBAL DEFAULT    1 _binary_fuzz_txt_end
     4: 00000000000011d0     0 NOTYPE  GLOBAL DEFAULT  ABS _binary_fuzz_txt_size

Check for failure from strdup

imp edited edge metadata.
This revision is now accepted and ready to land.Dec 9 2015, 6:37 PM
This revision was automatically updated to reflect the committed changes.