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)
Fri, Jun 21, 7:05 AM
Unknown Object (File)
Fri, Jun 21, 4:36 AM
Unknown Object (File)
Fri, Jun 21, 4:25 AM
Unknown Object (File)
Fri, Jun 21, 4:08 AM
Unknown Object (File)
Fri, Jun 21, 3:28 AM
Unknown Object (File)
Tue, Jun 18, 3:45 AM
Unknown Object (File)
Tue, Jun 18, 3:45 AM
Unknown Object (File)
Mon, Jun 17, 5:07 AM
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

Lint
Lint Skipped
Unit
Tests Skipped

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.