Skip to content

Commit

Permalink
convert note_data to a value from a pointer (#16661)
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright authored Jul 5, 2024
1 parent 048e350 commit 374b357
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions compiler/src/dmd/backend/elfobj.d
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ struct ElfObj

OutBuffer shndx_data; // Extended section header indices

OutBuffer* note_data; // Notes data (note currently used)
OutBuffer note_data; // Notes data (note currently used)

IDXSEC secidx_note; // Final table index for note data

Expand Down Expand Up @@ -607,7 +607,7 @@ Obj ElfObj_init(OutBuffer *objbuf, const(char)* filename, const(char)* csegname)
cseg = CODE;
elfobj.fobjbuf = objbuf;

elfobj.note_data = null;
elfobj.note_data.reset();
elfobj.secidx_note = 0;
elfobj.comment_data = null;
elfobj.seg_tlsseg = UNKNOWN;
Expand Down Expand Up @@ -722,8 +722,7 @@ Obj ElfObj_init(OutBuffer *objbuf, const(char)* filename, const(char)* csegname)
elfobj.shndx_data.reset();
elfobj.shndx_data.reserve(50 * (Elf64_Word).sizeof);

if (elfobj.note_data)
elfobj.note_data.reset();
elfobj.note_data.reset();

if (elfobj.comment_data)
elfobj.comment_data.reset();
Expand Down Expand Up @@ -1058,7 +1057,7 @@ void ElfObj_term(const(char)[] objfilename)

/* Next output any notes or comments
*/
if (elfobj.note_data)
if (elfobj.note_data.length())
{
sechdr = &elfobj.SecHdrTab[elfobj.secidx_note]; // Notes
sechdr.sh_size = cast(uint)elfobj.note_data.length();
Expand Down

0 comments on commit 374b357

Please sign in to comment.