0
#pragma comment(linker, "/merge:. data=. text")
#pragma comment(linker, "/merge:. rdata=. text")
#pragma comment(linker, "/section:. rdata=. text")

i try that, but ....

#[link_section = "/merge:. data=. text /merge:. rdata=. text /section:. rdata=. text"]

As a result, it adds a section directly.. it's bad

How should I implement it in rust

kmdreko
  • 42,554
  • 6
  • 57
  • 106

1 Answers1

0

You need to use this command:

cargo rustc -- -C link-args="/merge:.data=.text /merge:.rdata=.text /section:.text,RWE"
Jonathan Ciapetti
  • 1,261
  • 3
  • 11
  • 16